From f9d98066400e52ac0ef408c712d530b20513d822 Mon Sep 17 00:00:00 2001 From: Brad Chamberlain Date: Mon, 30 Oct 2023 11:16:56 -0700 Subject: [PATCH] Add test locking in issue #14813 @cassella noticed that this is now passing a few weeks back --- Signed-off-by: Brad Chamberlain --- test/arrays/bugs/arrOfRecordNoDefaultInit.chpl | 14 ++++++++++++++ test/arrays/bugs/arrOfRecordNoDefaultInit.good | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 test/arrays/bugs/arrOfRecordNoDefaultInit.chpl create mode 100644 test/arrays/bugs/arrOfRecordNoDefaultInit.good 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