Version 2.19.0-55.0.dev
Merge commit '1a1b739872b1c29ba82f7e29f92616a5384ebac4' into 'dev'
diff --git a/pkg/analyzer/lib/src/generated/ffi_verifier.dart b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
index 920c786..57d16b5 100644
--- a/pkg/analyzer/lib/src/generated/ffi_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
@@ -344,7 +344,9 @@
var ffiParameterTypes = ffiSignature.normalParameterTypes;
var ffiParameters = ffiSignature.parameters;
- if (declarationElement is MethodElement && !declarationElement.isStatic) {
+ if ((declarationElement is MethodElement ||
+ declarationElement is PropertyAccessorElementImpl) &&
+ !declarationElement.isStatic) {
// Instance methods must have the receiver as an extra parameter in the
// FfiNative annotation.
if (formalParameters.length + 1 != ffiSignature.parameters.length) {
diff --git a/pkg/analyzer/test/src/diagnostics/ffi_leaf_call_must_not_use_handle_test.dart b/pkg/analyzer/test/src/diagnostics/ffi_leaf_call_must_not_use_handle_test.dart
index e3e4c63..c0deefa 100644
--- a/pkg/analyzer/test/src/diagnostics/ffi_leaf_call_must_not_use_handle_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/ffi_leaf_call_must_not_use_handle_test.dart
@@ -50,12 +50,14 @@
await assertErrorsInCode(r'''
import 'dart:ffi';
-class A {
- @FfiNative<Handle Function()>('foo', isLeaf:true)
+class NativeFieldWrapperClass1 {}
+
+class A extends NativeFieldWrapperClass1 {
+ @FfiNative<Handle Function(Pointer<Void>)>('foo', isLeaf:true)
external Object get foo;
}
''', [
- error(FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, 32, 76),
+ error(FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, 100, 89),
]);
}
diff --git a/pkg/analyzer/test/src/diagnostics/ffi_native_test.dart b/pkg/analyzer/test/src/diagnostics/ffi_native_test.dart
index 638d75f..866072a 100644
--- a/pkg/analyzer/test/src/diagnostics/ffi_native_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/ffi_native_test.dart
@@ -16,6 +16,22 @@
@reflectiveTest
class FfiNativeTest extends PubPackageResolutionTest {
+ test_annotation_FfiNative_getters() async {
+ await assertErrorsInCode(r'''
+import 'dart:ffi';
+
+class NativeFieldWrapperClass1 {}
+
+class Paragraph extends NativeFieldWrapperClass1 {
+ @FfiNative<Double Function(Pointer<Void>)>('Paragraph::ideographicBaseline', isLeaf: true)
+ external double get ideographicBaseline;
+
+ @FfiNative<Void Function(Pointer<Void>, Double)>('Paragraph::ideographicBaseline', isLeaf: true)
+ external set ideographicBaseline(double d);
+}
+''', []);
+ }
+
test_annotation_FfiNative_noArguments() async {
await assertErrorsInCode(r'''
import 'dart:ffi';
diff --git a/tools/VERSION b/tools/VERSION
index 869309a..d57d2ef 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 19
PATCH 0
-PRERELEASE 54
+PRERELEASE 55
PRERELEASE_PATCH 0
\ No newline at end of file