You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When specifying a nested list type using @Default() like so: @Default(<List<dynamic>>[]), the generated code errors. If you use @Default(<List>[]) instead, it works fine.
Error details
[SEVERE] freezed on lib/example.dart:
An error `FormatterException` occurred while formatting the generated source for
`package:small_dart/example.dart`
which was output to
`lib/example.freezed.dart`.
This may indicate an issue in the generator, the input source code, or in the
source formatter.
Could not format because the source could not be parsed:
line 43, column 52 of .: Expected to find '}'.
╷
43 │ const _$ExampleClassImpl({final List<dynamic>>[]) List<List<dynamic>> data = const <List<dynamic>>[]}): _data = data;
│ ^
╵
line 20, column 2 of .: Methods must have an explicit list of parameters.
╷
20 │ List<dynamic>>[]) List<List<dynamic>> get data => throw _privateConstructorUsedError;
│ ^^^^
╵
line 20, column 15 of .: A function body must be provided.
╷
20 │ List<dynamic>>[]) List<List<dynamic>> get data => throw _privateConstructorUsedError;
│ ^
╵
line 20, column 15 of .: Operator declarations must be preceded by the keyword 'operator'.
╷
20 │ List<dynamic>>[]) List<List<dynamic>> get data => throw _privateConstructorUsedError;
│ ^
╵
line 20, column 15 of .: Methods must have an explicit list of parameters.
╷
20 │ List<dynamic>>[]) List<List<dynamic>> get data => throw _privateConstructorUsedError;
│ ^
╵
line 20, column 16 of .: A function body must be provided.
╷
20 │ List<dynamic>>[]) List<List<dynamic>> get data => throw _privateConstructorUsedError;
│ ^^
╵
line 20, column 16 of .: Operator declarations must be preceded by the keyword 'operator'.
╷
20 │ List<dynamic>>[]) List<List<dynamic>> get data => throw _privateConstructorUsedError;
│ ^^
╵
line 20, column 16 of .: Methods must have an explicit list of parameters.
╷
20 │ List<dynamic>>[]) List<List<dynamic>> get data => throw _privateConstructorUsedError;
│ ^^
╵
line 20, column 18 of .: A function body must be provided.
╷
20 │ List<dynamic>>[]) List<List<dynamic>> get data => throw _privateConstructorUsedError;
│ ^
╵
line 20, column 18 of .: Expected a class member.
╷
20 │ List<dynamic>>[]) List<List<dynamic>> get data => throw _privateConstructorUsedError;
│ ^
╵
Describe the bug
When specifying a nested list type using
@Default()
like so:@Default(<List<dynamic>>[])
, the generated code errors. If you use@Default(<List>[])
instead, it works fine.Error details
To Reproduce
Run build_runner on the class below:
Expected behavior
The build_runner process should've completed successfully and the generated code should be correct with no errors.
The text was updated successfully, but these errors were encountered: