Open jezell opened 2 hours ago
Summary: The user is experiencing build failures in Flutter Beta 3.27.0 when using the dart2js
compiler. The issue appears to be related to a breaking change in the compiler's behavior regarding anonymous functions and dynamic types. The user has provided a code snippet and build logs to illustrate the problem.
This gist fails to compile in Flutter Beta 3.27.0. There seems to be a breaking change dart2js in compiler behavior relating to anonymous functions / dynamics, but I'm having a hard time reducing to a simple repro.
https://gist.github.com/jezell/e6bb1adf6f57235d2cfb03dae1508746
result of flutter build web on beta
result on stable, build succeeds:
Attempting to reduce the problem by pulling some of the failing code into main fails in both stable and beta, yet importing the module itself only fails in beta.
I can fix the problem in beta by assigning the anonymous functions to typed function variables, before calling toJS but I can't explain why the compiler fails in beta and works in stable.