Community
Participate
Working Groups
Setting exception record's message field gets various Java compile errors package explore; library LogResults {} function assertTrue(info string, flag boolean) if (flag) syslib.writeStdOut("all good"); else syslib.writeStdOut("going to throw the exception"); throw new AssertionFailedException{message = info}; end end function assertTrue2(info string, flag boolean) local string = "loc " + info; if (flag) syslib.writeStdOut("all good"); else syslib.writeStdOut("going to throw the exception"); oopsy AssertionFailedException; oopsy.message = info; throw oopsy; end end end Record AssertionFailedException type Exception end
I was going to try fixing this today before anybody noticed the problem, but you beat me to it.
I've changed AnyExceptionTypeTemplate to fix the initial value of an exception. There's still more work to do before all of this is fixed.
FYI, the line "oopsy.message = info;" will result in a NullValueException. The exception "oopsy" declared in the previous line is null. Add {} to the declaration.
I changed RecordTemplate to properly generate assignments between two records that are references, such as exceptions. Bug 354957 must be fixed before your testcase will generate cleanly.
verified
Closing this defect.