displayString2() loses type substitutions for constructor invocation with type arguments #56933
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-question
A question about expected behavior or functionality
I hit this issue trying to migrate some code to the new Element model, but I couldn't figure out what the fix was...
The code I'm migrating is testing the hover on some code like
new A<String>()
. CallinggetDisplayString()
returns"A<String> A()"
but callingdisplayString2()
returns"A<T> A()"
:Stepping through
getDisplayString()
, it accessesExecutableMember.type
which calls_substitution.substituteType
before returning the type.However when stepping through
displayString2()
it accesses_element2
which accessesdeclaration.asElement2
. I don't know if it's this use ofdeclaration
that is losing the type substitutions?Here's a small repro test:
Which fails with:
@bwilkerson
The text was updated successfully, but these errors were encountered: