Skip to content

Commit

Permalink
#993. Change test to expect compile error if struct subclass created …
Browse files Browse the repository at this point in the history
…by the constructor
  • Loading branch information
Sergey G. Grekhov committed Feb 19, 2021
1 parent 191cd5e commit 3bfbaa7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions LibTest/ffi/Struct/Struct_A02_t01.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@
*/
/**
* @assertion Struct()
* Construct a reference to the nullptr.
* Instances of a subclass of Struct have reference semantics and are backed by
* native memory. The may allocated via allocation or loaded from a Pointer, but
* cannot be created by a generative constructor.
*
* @description Checks that this constructor constructs a reference to the
* nullptr.
* @description Checks that it is a compile time error if 'Struct' subclasses
* are created by generative constructor
* @author sgrekhov@unipro.ru
* @issue 44987
*/
import "dart:ffi";
import "../../../Utils/expect.dart";

class S1 extends Struct {
S1() : super();
}

void main() {
S1 s1 = new S1();
Expect.equals(nullptr.address, s1.addressOf.address);
// ^^
// [analyzer] unspecified
// [cfe] unspecified
}

0 comments on commit 3bfbaa7

Please sign in to comment.