Skip to content

Conversation

@jacksonrl
Copy link
Contributor

@jacksonrl jacksonrl commented Dec 9, 2025

Fixes #2784. Until now I was (unknowingly) using an old version that already supported this:

(old bindings)
final class WGPUVertexAttribute extends ffi.Struct {
  external ffi.Pointer<WGPUChainedStruct> nextInChain;

  @ffi.Int32()
  external int format;

  @ffi.Uint64()
  external int offset;

  @ffi.Uint32()
  external int shaderLocation;
}

This adds support for directly setting an enum without having to use enumAsInt.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.

@liamappelbe liamappelbe self-requested a review December 15, 2025 02:45
@github-actions
Copy link

PR Health

License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/hooks_runner/test_data/download_assets/hook/build.dart
pkgs/jni/test/debug_release_test.dart
pkgs/objective_c/example/command_line/lib/main.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

This check can be disabled by tagging the PR with skip-license-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@coveralls
Copy link

Coverage Status

coverage: 91.674% (-0.1%) from 91.818%
when pulling ff12396 on jacksonrl:enum-setters-clean
into 5765044 on dart-lang:main.

@coveralls
Copy link

coveralls commented Dec 15, 2025

Coverage Status

coverage: 91.819% (+0.001%) from 91.818%
when pulling bb3b4d8 on jacksonrl:enum-setters-clean
into 5765044 on dart-lang:main.

Copy link
Contributor

@liamappelbe liamappelbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. You just need to update a few more bindings to fix the test failures.

@jacksonrl
Copy link
Contributor Author

@liamappelbe it should be fixed now.

@liamappelbe
Copy link
Contributor

Thanks!

@liamappelbe liamappelbe merged commit 49661db into dart-lang:main Dec 15, 2025
26 checks passed
@jacksonrl jacksonrl deleted the enum-setters-clean branch December 15, 2025 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Structs are missing setters for dart-style enum members

3 participants