Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkgs/ffigen/lib/src/code_generator/objc_methods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ mixin ObjCMethods {
return oldMethod;
}

// If one of the methods is optional, and the other is required, keep the
// required one.
if (newMethod.isOptional && !oldMethod.isOptional) {
return oldMethod;
} else if (!newMethod.isOptional && oldMethod.isOptional) {
return newMethod;
}

// Check the duplicate is the same method.
if (!newMethod.sameAs(oldMethod)) {
_logger.severe('Duplicate methods with different signatures: '
Expand Down
Loading