compound_ implements_ finalizable
Details about the 'compound_implements_finalizable' diagnostic produced by the Dart analyzer.
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:
import 'dart:ffi';
final class S extends Struct implements Finalizable {
external Pointer notEmpty;
}
Common fixes
#Try removing the implements clause from the class:
import 'dart:ffi';
final class S extends Struct {
external Pointer notEmpty;
}
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.