@mono0926 found a compilation issue with Dart2js when running:
flutter run -t chrome --release
where the build output behaves differently from debug builds and VM builds.
The issue happens with the following code:
typedef Locator = void Function<T>();
class Bar {
Bar({this.read}) {
read<int>();
}
final Locator read;
}
void main() {
Bar(read: <T>() {
print(T);
return null;
});
}
The expected behavior of this code is to print int
in the console, which it does in debug builds and VM release builds.
But when running this code with flutter -t chrome --release
, this will print dynamic
This causes InheritedWIdgets
from Flutter to fail to be resolved
Taking a deeper look at this now since this is causing NNBD tests to fail.
The fix for this is causing test failures on dartdevc firefox
https://dart-review.googlesource.com/c/sdk/+/151301
introduced failures on firefox:
dartdevk-checked-linux-release-firefox
✔ language_2/regress/regress22443_test
✔ language_2/regress/regress23244_test
Pass -> RuntimeError (expected Pass)
Timeout -> RuntimeError (expected Pass)
I checked on it, by looking in the results.json for the build after the one they were reported on.
They were detected to be flaky in that next build, so they stopped being reported on the results feed, and the previous failure was not marked as “superceded” (inactive, replaced by a more recent change).
This failure has happened a number of times before, and confuses everyone and wastes their time.
The fix is to report a change in flaky status to the results feed, and mark earlier failures on now flaky tests as inactive.
I see now that fixing this is urgent, because it wastes so many users’ time when it happens.
dart-lang/dart_ci#98
My apologies – I closed the issue when my fix landed and our tests started passing, but it looks like there’s still another bug lurking around when
--omit-implicit-checks
is passed. I’ll add another test and investigate.The initial fix for this was pretty quick, but revealed a deeper issue causing other tests (mainly async ones) to fail. I have a more complete fix that I’m working on landing now.
HI @ochmist – the fix landed in 5671730, which is part of Dart’s 2.10.0-1.0.dev release and newer releases.
I am not sure on which flutter release this version was rolled into. When I try
flutter doctor -v
, I see already a newer version of the Dart sdk in the master channel:So the fix should be there. Is the Dart version in your case further behind? Is this resolved after upgrading to the latest flutter?