-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
cfe-dysfunctionalitiesIssues for the CFE not behaving as intendedIssues for the CFE not behaving as intendedlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.model-field-promotionImplementation of field promotionImplementation of field promotion
Description
The following code is accepted by the analyzer but rejected by the CFE:
class C {
final int? _property;
C(this._property);
}
int test(C c) {
c._property ?? (throw '');
return c._property;
}
main() {}The CFE reports this error:
test.dart:7:12: Error: A value of type 'int?' can't be returned from a function with return type 'int' because 'int?' is nullable and 'int' isn't.
return c._property;
^
I'm working on a fix.
parlough
Metadata
Metadata
Assignees
Labels
cfe-dysfunctionalitiesIssues for the CFE not behaving as intendedIssues for the CFE not behaving as intendedlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.model-field-promotionImplementation of field promotionImplementation of field promotion