Skip to content

Commit

Permalink
Add test locking in fix for issue chapel-lang#14813 (chapel-lang#23736)
Browse files Browse the repository at this point in the history
Thanks to @cassella for noticing that this is now passing a few weeks
back. Here, I'm filing the code from the issue to lock in the behavior
going forward.
  • Loading branch information
bradcray authored Oct 30, 2023
2 parents a732f6a + f9d9806 commit 1b249d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/arrays/bugs/arrOfRecordNoDefaultInit.chpl
Original file line number Diff line number Diff line change
@@ -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 );
}
2 changes: 2 additions & 0 deletions test/arrays/bugs/arrOfRecordNoDefaultInit.good
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
x = (num = 1), type = Rec
r = (num = 1), type = [domain(1,int(64),one)] Rec

0 comments on commit 1b249d7

Please sign in to comment.