diff --git a/test/types/records/const-checking/array-of-owned-const.bad b/test/types/records/const-checking/array-of-owned-const.bad new file mode 100644 index 000000000000..e736bf66fb6c --- /dev/null +++ b/test/types/records/const-checking/array-of-owned-const.bad @@ -0,0 +1,3 @@ +nil nil +nil nil +{x = 1} {x = 2} diff --git a/test/types/records/const-checking/array-of-owned-const.chpl b/test/types/records/const-checking/array-of-owned-const.chpl new file mode 100644 index 000000000000..808c100773bd --- /dev/null +++ b/test/types/records/const-checking/array-of-owned-const.chpl @@ -0,0 +1,15 @@ +class C { var x: int; } + +proc main() { + var X: [1..2] owned C?; + X[1] = new owned C(1); + X[2] = new owned C(2); + + const Y = X; + + const Z = Y; + + writeln(X); + writeln(Y); + writeln(Z); +} diff --git a/test/types/records/const-checking/array-of-owned-const.future b/test/types/records/const-checking/array-of-owned-const.future new file mode 100644 index 000000000000..42fda9af7029 --- /dev/null +++ b/test/types/records/const-checking/array-of-owned-const.future @@ -0,0 +1,2 @@ +bug: missing const checking for init-copy from const array of owned class? +#14923 diff --git a/test/types/records/const-checking/array-of-owned-const.good b/test/types/records/const-checking/array-of-owned-const.good new file mode 100644 index 000000000000..a02839f21448 --- /dev/null +++ b/test/types/records/const-checking/array-of-owned-const.good @@ -0,0 +1 @@ +const checking error on `const Z = Y;`