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();
}
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.