Skip to content

Commit 539b0e2

Browse files
goderbauerCommit Queue
authored andcommitted
Refactor regression_44985_test.dart
Change-Id: I0e5788dd5e0636927df1e961cc00b104bc2b21a9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409843 Commit-Queue: Daco Harkes <[email protected]> Reviewed-by: Daco Harkes <[email protected]>
1 parent b976aef commit 539b0e2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

runtime/docs/contributing_to_dart_ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Unit tests
8989

9090
Integration tests
9191

92-
- `tests/ffi/static_checks/(.*)_test.dart`. Prefer creating new tests with the “new style” `// [analyzer] ...`. The tests can be run with `$ tools/build.py -mrelease runtime create_platform_sdk && tools/test.py -cfasta -mrelease tests/ffi/static_checks/vmspecific_static_checks_array_test.dart`. These tests require rebuilding the SDK. These tests also can contain `// [cfe] ...` error expectations. Which makes them good for checking that the behavior is similar in the CFE and analyzer implementation. And because these test files are standalone Dart, you can easily pass them as an argument to the analyzer when running from source in the debugger.
92+
- `tests/ffi/static_checks/(.*)_test.dart`. Prefer creating new tests with the “new style” `// [analyzer] ...`. The tests can be run with `$ tools/build.py -mrelease runtime create_platform_sdk && tools/test.py -cfasta -cdart2analyzer -mrelease tests/ffi/static_checks/vmspecific_static_checks_array_test.dart`. These tests require rebuilding the SDK. These tests also can contain `// [cfe] ...` error expectations. Which makes them good for checking that the behavior is similar in the CFE and analyzer implementation. And because these test files are standalone Dart, you can easily pass them as an argument to the analyzer when running from source in the debugger.
9393

9494

9595
## Running in the debugger

tests/ffi/static_checks/regress_44985_test.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// Formatting can break multitests, so don't format them.
6-
// dart format off
7-
85
import "dart:ffi";
96

107
final class S2 extends Struct {
118
external Pointer<Int8> notEmpty;
129

13-
external Struct? s; //# 01: compile-time error
10+
external Struct? s;
11+
// ^^^^^^^
12+
// [analyzer] COMPILE_TIME_ERROR.INVALID_FIELD_TYPE_IN_STRUCT
13+
// ^
14+
// [cfe] Field 's' cannot be nullable or have type 'Null', it must be `int`, `double`, `Pointer`, or a subtype of `Struct` or `Union`.
1415
}
1516

1617
void main() {

0 commit comments

Comments
 (0)