New Issue: Unclear error message points to internal 'OwnedObject.chpl' module

19114, "bradcray", "Unclear error message points to internal 'OwnedObject.chpl' module", "2022-01-26T01:05:58Z"

Summary of Problem

While writing code using classes, I got an unclear error message pointing to the internal OwnedObject.chpl module. Capturing it here as motivation to improve it, and in case others hit the same issue.

$CHPL_HOME/modules/internal/OwnedObject.chpl:167: In initializer:
$CHPL_HOME/modules/internal/OwnedObject.chpl:172: error: Could not coerce 'nil' to 'borrowed Node?' in initialization
  $CHPL_HOME/modules/internal/OwnedObject.chpl:247: called as owned.init(type chpl_t = borrowed Node?)
  within internal functions (use --print-callstack-on-error to see)
  day18-bug2.chpl:20: called as lineToTree(line: string, pos: int(64))

Steps to Reproduce

Associated Future Test(s):
test/studies/adventOfCode/2021/bradc/futures/day18-bug2.chpl #19028

Configuration Information

  • Output of chpl --version: chpl version 1.26.0 pre-release (56bd177336)