Skip to content

Commit

Permalink
Add futures showing default initialization of tuples of arrays doesn'…
Browse files Browse the repository at this point in the history
…t work

This is a capture of the issue originally report in issue chapel-lang#15759,
though the behavior is now improved (in that it generates a
user-facing error rather than a segfault), leading to chapel-lang#17050.

---
Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
  • Loading branch information
bradcray committed Jan 29, 2021
1 parent a721b8d commit aab08c0
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/arrays/bugs/arrOfTupleOfArr2.bad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arrOfTupleOfArr2.chpl:7: error: default initialization of tuple containing array or domain type not yet implemented
8 changes: 8 additions & 0 deletions test/arrays/bugs/arrOfTupleOfArr2.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
proc foo() {
return ([1,2,3], [1.2,3.4,5.6]);
}

var x = foo();
type t = x.type;
var A: [1..2] t;
writeln(A);
3 changes: 3 additions & 0 deletions test/arrays/bugs/arrOfTupleOfArr2.future
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
unimplemented feature: support default-initialized tuples of arrays

#17050
1 change: 1 addition & 0 deletions test/arrays/bugs/arrOfTupleOfArr2.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(0 0 0, 0.0 0.0 0.0) (0 0 0, 0.0 0.0 0.0)
1 change: 1 addition & 0 deletions test/arrays/bugs/arrOfTupleOfArr3.bad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arrOfTupleOfArr3.chpl:1: error: default initialization of tuple containing array or domain type not yet implemented
2 changes: 2 additions & 0 deletions test/arrays/bugs/arrOfTupleOfArr3.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
var A: [1..2] ([1..3] int, [1..3] real);
writeln(A);
3 changes: 3 additions & 0 deletions test/arrays/bugs/arrOfTupleOfArr3.future
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
unimplemented feature: support default-initialized tuples of arrays

#17050
1 change: 1 addition & 0 deletions test/arrays/bugs/arrOfTupleOfArr3.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(0 0 0, 0.0 0.0 0.0) (0 0 0, 0.0 0.0 0.0)
1 change: 1 addition & 0 deletions test/arrays/bugs/arrOfTupleOfArr4.bad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arrOfTupleOfArr4.chpl:4: error: default initialization of tuple containing array or domain type not yet implemented
6 changes: 6 additions & 0 deletions test/arrays/bugs/arrOfTupleOfArr4.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type arrOfInt = [1..3] int;
type arrOfReal = [1..3] real;
type tupOfArrs = (arrOfInt, arrOfReal);
var A: [1..2] tupOfArrs;
writeln(A);

3 changes: 3 additions & 0 deletions test/arrays/bugs/arrOfTupleOfArr4.future
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
unimplemented feature: support default-initialized tuples of arrays

#17050
1 change: 1 addition & 0 deletions test/arrays/bugs/arrOfTupleOfArr4.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(0 0 0, 0.0 0.0 0.0) (0 0 0, 0.0 0.0 0.0)
1 change: 1 addition & 0 deletions test/arrays/bugs/arrOfTupleOfArr5.bad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arrOfTupleOfArr5.chpl:5: error: default initialization of tuple containing array or domain type not yet implemented
6 changes: 6 additions & 0 deletions test/arrays/bugs/arrOfTupleOfArr5.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
proc foo() {
return ([1,2,3], [1.2,3.4,5.6]);
}

var A: [1..2] foo().type;
writeln(A);
3 changes: 3 additions & 0 deletions test/arrays/bugs/arrOfTupleOfArr5.future
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
unimplemented feature: support default-initialized tuples of arrays

#17050
1 change: 1 addition & 0 deletions test/arrays/bugs/arrOfTupleOfArr5.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(0 0 0, 0.0 0.0 0.0) (0 0 0, 0.0 0.0 0.0)
4 changes: 4 additions & 0 deletions test/arrays/bugs/arrOfTupleOfArr6.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var A = [([1,2,3], [1.2,3.4,5.6]),
([1,2,3], [1.2,3.4,5.6]),
([1,2,3], [1.2,3.4,5.6])];
writeln(A);
1 change: 1 addition & 0 deletions test/arrays/bugs/arrOfTupleOfArr6.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(1 2 3, 1.2 3.4 5.6) (1 2 3, 1.2 3.4 5.6) (1 2 3, 1.2 3.4 5.6)

0 comments on commit aab08c0

Please sign in to comment.