-
Notifications
You must be signed in to change notification settings - Fork 66
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
AssignFinal to nullable type doesn't generate the nullable type #315
Comments
Yeah I see a few issues with void main() {
final statement2 = refer('foo')
.assignFinal(
'bar',
TypeReference((b) => b
..symbol = 'List'
..types.add(refer('int'))))
.statement;
print(DartFormatter().format(
'${statement2.accept(DartEmitter.scoped())}'));
} prints |
Ah indeed. I use |
Probably related to dart-lang/code_builder#315
still waiting for a fix |
|
Towards #315 Add a skipped test which demonstrates that the nullability of a type reference is ignored when emitting a variable assignment.
Towards #315 Add a skipped test which demonstrates that the nullability of a type reference is ignored when emitting a variable assignment.
When using code_builder I noticed that if I use
assignFinal
with a nullable type, it doesn't output the question mark.Reproduction recipe:
Output:
final String bar = foo;
Expected:
final String? bar = foo;
Is this a bug or am I missing something obvious here? Thanks for the great package, it's a joy to use!
The text was updated successfully, but these errors were encountered: