Closed
Description
When code opts into Dart 3.0, we need to add class modifiers.
All subtypes of Struct
, Union
, Opaque
, and AbiSpecificInteger
need to become final class
instead of class.
If the code is being generated for pre-3.0, we need to generate class
, because final class
is not accepted by the parser.
This means we have two options:
- Tell people to use an older version of FFIgen if they want to target an older version of the SDK. (We often bump the lower SDK constraint when targeting new
dart:ffi
features anyway.) - Add an optional language-version config var, which determines what we output.
I'm not sure of option 2 is worth it though. For example VarArgs
only exists in 3.0 and we will add that as well when Dart 3.0 is out.