Open

Description
@johnpryan commented on Apr 8, 2021, 12:12 AM UTC:
Result checkLottery(bool isLucky) {
String? nullString;
if (isLucky) {
nullString = 'You win!';
}
if (nullString != null) {
// Use this to fix:
// var nonNullString = nullString;
return () {
return Result(nullString);
// ^ The argument type 'String?' can't be assigned to the parameter type 'String'.
}();
}
return Result('You lose.');
}
@leafpetersen is there already an issue for this? I think this is called out in #44900
This issue was moved by keertip from dart-lang/sdk#45622.
Metadata
Metadata
Assignees
Labels
No labels