Calling a method on a generic error within a catch block results in a nil-checking error.
Source Code:
proc hello() {
try {
writeln('hello');
} catch e {
writeln(e.message());
}
}
hello();
nilCheck.chpl:1: In function 'hello':
nilCheck.chpl:5: error: attempt to dereference nil
nilCheck.chpl:2: note: this statement may be relevant
chpl --version: chpl version 1.20.0 pre-release (775dd4ff11)@mppf - this is the error I was talking to you about offline.
See also #11918
This impacts some application code, but it is not a gating issue b/c a work-around exists:
proc hello() {
try {
writeln('hello');
} catch e {
var error = e: Error;
writeln(error.message());
}
}
hello();
@ben-albrecht - I'm expecting @vasslitvinov's PR #13314 to fix it.
Right. See:
test/classes/nilability/catch-no-throw.chpl