-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/packages
#1543Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: null-safetySupport for Dart's null safety featureSupport for Dart's null safety featurec: crashStack traces logged to the consoleStack traces logged to the consolep: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
Nonnull enums are broken now even with a wrapper class. Switching the enum to a nullable in the class fixes it.
Steps to Reproduce
Interface:
enum MyState {
Idle,
}
class MyWrapper {
late MyState state;
}
@FlutterApi
abstract class MyApi {
void setState(MyWrapper state);
}
Error:
30: pigeonMap['state'] = state == null ? null : state!.index; (warning) The '!' will have no effect because the receiver can't be null.
#unnecessary_non_null_assertion
39: state: pigeonMap['state'] != null The argument type 'MyState?' can't be assigned to the parameter type
'MyState'. #argument_type_not_assignablebparrishMines
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: null-safetySupport for Dart's null safety featureSupport for Dart's null safety featurec: crashStack traces logged to the consoleStack traces logged to the consolep: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version