Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
liamappelbe committed Sep 28, 2023
1 parent ad26be6 commit 0820df8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions lib/src/code_generator/objc_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,18 @@ class $name extends ${superType?.name ?? '_ObjCWrapper'} {
for (final method in methods.values) {
final superMethod = superType_.methods[method.originalName];
if (superMethod != null) {
if (superMethod.returnType.typealiasType is! ObjCNullable && method.returnType.typealiasType is ObjCNullable) {
if (superMethod.returnType.typealiasType is! ObjCNullable &&
method.returnType.typealiasType is ObjCNullable) {
superMethod.returnType = ObjCNullable(superMethod.returnType);
}
final numArgs = method.params.length < superMethod.params.length ?
method.params.length : superMethod.params.length;
final numArgs = method.params.length < superMethod.params.length
? method.params.length
: superMethod.params.length;
for (int i = 0; i < numArgs; ++i) {
final param = method.params[i];
final superParam = superMethod.params[i];
if (superParam.type.typealiasType is ObjCNullable && param.type.typealiasType is! ObjCNullable) {
if (superParam.type.typealiasType is ObjCNullable &&
param.type.typealiasType is! ObjCNullable) {
param.type = ObjCNullable(param.type);
}
}
Expand Down
3 changes: 2 additions & 1 deletion test/native_objc_test/nullable_inheritance_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ void main() {
group('Nullable inheritance', () {
setUpAll(() {
logWarnings();
final dylib = File('test/native_objc_test/nullable_inheritance_test.dylib');
final dylib =
File('test/native_objc_test/nullable_inheritance_test.dylib');
verifySetupFile(dylib);
lib = NullableInheritanceTestObjCLibrary(
DynamicLibrary.open(dylib.absolute.path));
Expand Down
3 changes: 1 addition & 2 deletions test/native_objc_test/nullable_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ void main() {

group('Not-nullable arguments', () {
test('Not null', () {
expect(
NullableInterface.isNullWithNotNullableNSObjectPtrArg_(lib, obj),
expect(NullableInterface.isNullWithNotNullableNSObjectPtrArg_(lib, obj),
false);
});
});
Expand Down

0 comments on commit 0820df8

Please sign in to comment.