-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apparent regression in always_specify_types
with typedef
#3275
Comments
It looks like
That puts the regression range for the engine between 6576bd428ae1f9556924d06211b77a540b5a3d5a and 1875f0ad3f54c8cc12ffbe20c05d54a01781e564, which points to flutter/engine#31864 https://dart.googlesource.com/sdk.git/+/1cdfaa85878a42444e026b823fdb356c6fd35612 sounds suspicious in that very small range. @stereotype441 @scheglov |
That commit does indeed look suspicious! Especially considering the suspicious nature of its author 😃 |
Ok, I think what has happened is that in the example: typedef Foo = Map<String, Object>;
final Foo foo = Foo(); when visiting the NamedType for the I'll continue the investigation from here. |
Thanks for the great repro @stuartmorgan! This case was previously untested. (Test added w/ #3277.) |
In some circumstances, the analyzer doesn't reliably set DartType.alias to point to the type alias that led to a type. (This is the ultimate cause of #3275). I'm currently researching whether it's possible to improve the analyzer behavior in this regard. In the meantime, we can fix #3275 by changing the linter to grab the type alias element directly from NamedType.name.staticElement. Fixes #3275.
In some circumstances, the analyzer doesn't reliably set DartType.alias to point to the type alias that led to a type. (This is the ultimate cause of #3275). I'm currently researching whether it's possible to improve the analyzer behavior in this regard. In the meantime, we can fix #3275 by changing the linter to grab the type alias element directly from NamedType.name.staticElement. Fixes #3275.
…ng/linter#3279) In some circumstances, the analyzer doesn't reliably set DartType.alias to point to the type alias that led to a type. (This is the ultimate cause of dart-lang/linter#3275). I'm currently researching whether it's possible to improve the analyzer behavior in this regard. In the meantime, we can fix dart-lang/linter#3275 by changing the linter to grab the type alias element directly from NamedType.name.staticElement. Fixes dart-lang/linter#3275.
Describe the issue
#2692 seems to have (partially?) regressed recently on Flutter master. We have an auto-roller that rolls flutter/flutter into flutter/packages, and it started failing sometime in the last week or so (I still need to pinpoint the exact regression point) due to new issues with the
analyze
step we run in CI (example failure).The failures are:
An example failing line is:
where the failure shows as being the
DynamicMap()
part. ButDynamicMap
isInterestingly it doesn't have an issue with the declaration of
results
, just the constructor call.Other failures are
DynamicMap.fromEntries
andDynamicList.generate
(whereDynamicList
is a similar typedef forList<Object?>
).To Reproduce
Minimal example:
Expected behavior
No
always_specify_types
lint.Additional context
Changing the second line to
makes the lint message go away, so it's definitely the typedef.
The text was updated successfully, but these errors were encountered: