Closed
Description
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: