mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 02:07:06 +00:00
dc2c739a6c
The FfiNative transform was trying to access the generated struct constructor which is added to the AST in the FFI definitions transform. The FFI definitions transform has to run _before_ the FFI native transform. TEST=tests/ffi/regress_51321_test.dart Closes: https://github.com/dart-lang/sdk/issues/51321 Change-Id: I6b5caf6e5851455cece6aec13ef73d85cc201ebf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282103 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com>
20 lines
431 B
Dart
20 lines
431 B
Dart
// Copyright (c) 2023, 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.
|
|
//
|
|
// Regression test for http://dartbug.com/51321.
|
|
|
|
import 'dart:ffi';
|
|
|
|
class Foo extends Struct {
|
|
@IntPtr()
|
|
external int bar;
|
|
}
|
|
|
|
@Native<Foo Function()>()
|
|
external Foo getFoo();
|
|
|
|
main() {
|
|
print('hello!');
|
|
}
|