abi_specific_integer_mapping_unsupported
Invalid mapping to '{0}'; only mappings to 'Int8', 'Int16', 'Int32', 'Int64', 'Uint8', 'Uint16', 'UInt32', and 'Uint64' are supported.
Description
#The analyzer produces this diagnostic when a value in the map argument of
an AbiSpecificIntegerMapping
annotation is anything other than one of
the following integer types:
Int8
Int16
Int32
Int64
Uint8
Uint16
UInt32
Uint64
Example
#The following code produces this diagnostic because the value of the map
entry is Array<Uint8>
, which isn't a valid integer type:
dart
import 'dart:ffi';
@AbiSpecificIntegerMapping({Abi.macosX64 : Array<Uint8>(4)})
final class C extends AbiSpecificInteger {
const C();
}
Common fixes
#Use one of the valid types as a value in the map:
dart
import 'dart:ffi';
@AbiSpecificIntegerMapping({Abi.macosX64 : Int8()})
final class C extends AbiSpecificInteger {
const C();
}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。