Skip to content

Create method/function fixes don't handle type parameters of actual types #62199

@FMorschel

Description

@FMorschel

While fixing #61186, I noticed this repro below had no Create method fix:

class A {}

T? Function<T>() g(A a) => a.test<T>;

I've made it work, but if we had:

class A {}

int Function() g(A a) => a.test<int>; // Note this is not a `TypeParameterType`

We should be able to create new type arguments for something like:

class A {
  int test<T>() {}
}

int Function() g(A a) => a.test<int>;

We'd have to think of the correct way to create those type arguments, but I think we can probably come up with a reasonable definition.

The same goes for the invocation case, for both method and function. We currently would create a method/function with no type parameters:

class A {}

int? g(A a) => a.test<int>();

This issue is to track fixing the second case only, since the first case will be handled on a new CL for #61186.

CC @bwilkerson

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions