-
Notifications
You must be signed in to change notification settings - Fork 163
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
bool.fromEnvironment('dart.library.js_util')
(and alike?) constant can't be revived, breaking the codegen
#683
Comments
I can reproduce with just class X {
void m({bool b = kIsWeb}) { print(b); }
} ( The thing is @srawlins Could you please confirm this never worked and this is not a regression? |
Corr: it's not just As a quick fix we could probably detect this and try just referencing the constant instead. Won't work with Longer term I had an idea how we could get rid of the need to revive default values:
That's just a sketch but I think it could be made to work. At the same time it seems a bit too complex. So probably even a longer term we should do a breaking API change and separate mocks from their configuration objects as Lasse proposed long ago. So config object will be generated but it won't need any default args. And mocks won't have any overrides except for nSM, so they will get the right default values for free. |
bool.fromEnvironment('dart.library.js_util')
(and alike?) constant can't be revived, braking the codegen
bool.fromEnvironment('dart.library.js_util')
(and alike?) constant can't be revived, braking the codegenbool.fromEnvironment('dart.library.js_util')
(and alike?) constant can't be revived, breaking the codegen
@dustincatap For you one possible fix will be to wrap We could come up with some quick fix, but I can't promise that. And a longer term solution won't be implemented any time soon. |
Hi. I don't know if this issue is valid for this repository.
I am having trouble generating mocks when using
auto_route
.Running
dart run build_runner build --verbose
outputs this error:Here is a sample project
The text was updated successfully, but these errors were encountered: