Skip to content

co19/LibTest/ffi/Pointer/elementAt_A02_t01 #1601

Closed
@dcharkes

Description

@dcharkes
void main() {
  Pointer<Int64> p1 = calloc<Int64>(3);
  try {
    Pointer<Void> p2 = new Pointer.fromAddress(p1.address);
    Expect.throws(() {
      p2.elementAt(1);
    });
  } finally {
    calloc.free(p1);
  }
}

This should have always been a compile error, but was accidentally a runtime error before.

https://dart-review.googlesource.com/c/sdk/+/276102 turns this into a compile error.

Please fix the test to expect a compile-time error instead.

For more context:

Metadata

Metadata

Assignees

Labels

bad-testReport tests in need of updates. When closed, the tests should be considered good

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions