-
Notifications
You must be signed in to change notification settings - Fork 3.6k
ignore #10232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore #10232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a substantial new feature for JNI and FFI support in Pigeon, alongside various formatting and refactoring changes across the codebase. The core of the changes lies in the Dart, Swift, and Kotlin generators. My review has focused on identifying critical issues and potential bugs. I've found hardcoded local paths in test configuration files that must be addressed, as well as an empty file that appears to be an accidental addition. Additionally, I've identified a potential bug in the Dart generator's handling of FFI enums. The remaining changes, including formatting and refactoring, seem reasonable and consistent with the new feature implementation.
| ObjCCompatibleSwiftFileInput( | ||
| files: <Uri>[ | ||
| Uri.file( | ||
| '/Users/tarrinneal/work/packages/packages/pigeon/platform_tests/test_plugin/darwin/test_plugin/Sources/test_plugin/NiTests.gen.swift', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -0,0 +1,25 @@ | |||
| android_sdk_config: | |||
| add_gradle_deps: true | |||
| android_example: '/Users/tarrinneal/work/packages/packages/pigeon/platform_tests/test_plugin/example' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (type.isEnum && !type.isNullable) { | ||
| return 'ffi_bridge.${type.baseName}.values[$name]'; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This special handling for non-nullable enums appears to be incorrect. The generated code ffi_bridge.${type.baseName}.values[$name] attempts to access a Dart enum from an FFI bridge file, which won't work as the bridge file contains FFI bindings, not Dart code.
The native function expects an integer representation for the enum. The name variable already holds the correct integer value (myField.index). The fallback logic using _PigeonFfiCodec.writeValue correctly handles converting an integer to an NSNumber, which is the expected behavior.
Removing this block will allow the general _PigeonFfiCodec.writeValue to handle non-nullable enums correctly, consistent with how nullable enums are handled.
| @@ -0,0 +1 @@ | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.