We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Default
Hey there 👋🏼 !
I found an interesting bug when using freezed for classes with members with default values.
freezed
If I create a const instance of a default annotation, the generated code is not valid.
Given the following code snippet:
const defaultFalse = Default(false); @freezed class MyClass with _$MyClass { const factory MyClass({ @defaultFalse bool myBool, }) = _MyClass; }
After running code generation, part of the generated code includes this output:
class _$_MyClass implements _MyClass { const _$_MyClass({this.myBool = als}); // <========= 👀 /// ... more generated code .... }
-const _$_MyClass({this.myBool = als}); +const _$_MyClass({this.myBool = false});
The text was updated successfully, but these errors were encountered:
rrousselGit
No branches or pull requests
Bug description
Hey there 👋🏼 !
I found an interesting bug when using
freezed
for classes with members with default values.If I create a const instance of a default annotation, the generated code is not valid.
Reproduction setup
Given the following code snippet:
After running code generation, part of the generated code includes this output:
Expected output
The text was updated successfully, but these errors were encountered: