compound_implements_finalizable
The class '{0}' can't implement Finalizable.
Description
#The analyzer produces this diagnostic when a subclass of either Struct
or Union
implements Finalizable
.
For more information about FFI, see C interop using dart:ffi.
Example
#The following code produces this diagnostic because the class S
implements Finalizable
:
dart
import 'dart:ffi';
final class S extends Struct implements Finalizable {
external Pointer notEmpty;
}
Common fixes
#Try removing the implements clause from the class:
dart
import 'dart:ffi';
final class S extends Struct {
external Pointer notEmpty;
}
Was this page's content helpful?
Thank you for your feedback!
Provide details Thank you for your feedback! Please let us know what we can do to improve.
Provide details Unless stated otherwise, the documentation on this site reflects Dart 3.8.1. Page last updated on 2025-05-08. View source or report an issue.