Skip to content

Commit 2f325ab

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Tweaks for FfiVerifier.
Change-Id: Ic75582d17a06dbf81e84d15cf2959326ef32855f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220061 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent cad8a34 commit 2f325ab

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

pkg/analyzer/lib/src/generated/ffi_verifier.dart

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class FfiVerifier extends RecursiveAstVisitor<void> {
2525
static const _opaqueClassName = 'Opaque';
2626
static const _ffiNativeName = 'FfiNative';
2727

28-
static const List<String> _primitiveIntegerNativeTypes = [
28+
static const Set<String> _primitiveIntegerNativeTypes = {
2929
'Int8',
3030
'Int16',
3131
'Int32',
@@ -35,12 +35,12 @@ class FfiVerifier extends RecursiveAstVisitor<void> {
3535
'Uint32',
3636
'Uint64',
3737
'IntPtr'
38-
];
38+
};
3939

40-
static const List<String> _primitiveDoubleNativeTypes = [
40+
static const Set<String> _primitiveDoubleNativeTypes = {
4141
'Float',
4242
'Double',
43-
];
43+
};
4444

4545
static const _primitiveBoolNativeType = 'Bool';
4646

@@ -1516,13 +1516,7 @@ extension on NamedType {
15161516
bool get isCompoundSubtype {
15171517
var element = name.staticElement;
15181518
if (element is ClassElement) {
1519-
bool isCompound(InterfaceType? type) {
1520-
return type != null && type.isCompound;
1521-
}
1522-
1523-
return isCompound(element.supertype) ||
1524-
element.interfaces.any(isCompound) ||
1525-
element.mixins.any(isCompound);
1519+
return element.allSupertypes.any((e) => e.isCompound);
15261520
}
15271521
return false;
15281522
}

0 commit comments

Comments
 (0)