Skip to content

Dart 3.0 class modifiers #476

Closed
Closed
@dcharkes

Description

@dcharkes

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:

  1. 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.)
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions