diff --git a/test/arrays/bugs/arrOfRecordNoDefaultInit.chpl b/test/arrays/bugs/arrOfRecordNoDefaultInit.chpl new file mode 100644 index 000000000000..309153d9c39f --- /dev/null +++ b/test/arrays/bugs/arrOfRecordNoDefaultInit.chpl @@ -0,0 +1,14 @@ +record Rec +{ + var num : int; + proc init( n: int ) { num = n; } // 0-arg init() not defined +} + +proc main() +{ + var x = new Rec(n = 1); // this works + writeln( "x = ", x, ", type = ", x.type:string ); + + var r = [ new Rec(n = 1) ]; // this fails + writeln( "r = ", r, ", type = ", r.type:string ); +} diff --git a/test/arrays/bugs/arrOfRecordNoDefaultInit.good b/test/arrays/bugs/arrOfRecordNoDefaultInit.good new file mode 100644 index 000000000000..583bd7c38e93 --- /dev/null +++ b/test/arrays/bugs/arrOfRecordNoDefaultInit.good @@ -0,0 +1,2 @@ +x = (num = 1), type = Rec +r = (num = 1), type = [domain(1,int(64),one)] Rec