Type parameters do not shadow library prefixes in instance creation expressions #33005
Labels
analyzer-spec
Issues with the analyzer's implementation of the language spec
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone
Given:
And:
I expect an error on the marked line because T should refer to Bar's type parameter, not the import prefix T. Instead, all I get from analyzer is:
If I use T inside
test()
in some other kind of expression, I get the expected error. I think it's only when used in anew ...
expression that it doesn't get the scope right.I stumbled onto this while converting the language_2/prefix negative tests to be multitests, so this is probably an ancient bug that was never caught because negative tests make it too easy to mistake the true cause of a failure.
The text was updated successfully, but these errors were encountered: