diff --git a/pkg/analyzer/lib/src/generated/ffi_verifier.dart b/pkg/analyzer/lib/src/generated/ffi_verifier.dart index 1945d8a00c6..58adcc8c045 100644 --- a/pkg/analyzer/lib/src/generated/ffi_verifier.dart +++ b/pkg/analyzer/lib/src/generated/ffi_verifier.dart @@ -156,6 +156,7 @@ class FfiVerifier extends RecursiveAstVisitor { } } super.visitClassDeclaration(node); + inCompound = false; } @override diff --git a/tests/ffi/regress_52298_test.dart b/tests/ffi/regress_52298_test.dart new file mode 100644 index 00000000000..cbdc9c66047 --- /dev/null +++ b/tests/ffi/regress_52298_test.dart @@ -0,0 +1,17 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:ffi'; + +final class Foo extends Struct { + external Pointer field; +} + +mixin Bar { + late final field = 123; +} + +void main() { + print('something'); +}