[Chapel Merge] Properly handle erroneous expressions

Branch: refs/heads/main
Revision: 87ef1603099a52463e48e5e95ac7feaf880c33c6
Author: jabraham17
Link: Properly handle erroneous expressions by jabraham17 · Pull Request #28841 · chapel-lang/chapel · GitHub
Log Message:
Properly handle erroneous expressions (#28841)

Avoid assertion error by handling erroneous expressions so that the user
error is properly propagated

Resolves [Bug]: Forwarding to a badly formatted `var` declaration causes an internal error · Issue #25067 · chapel-lang/chapel · GitHub

  • paratest

[Reviewed by @DanilaFe]

Compare: Comparing aa39cd1e641cece920c3be256bc5d95382ea10d8...d316fb2e7e9e868443f22fde38a3cfaf4a1778b1 · chapel-lang/chapel · GitHub

Diff:
M frontend/lib/parsing/ParserContextImpl.h
D test/classes/forwarding/forwardToNonVar.bad
D test/classes/forwarding/forwardToNonVar.future
M test/classes/forwarding/forwardToNonVar.good
https://github.com/chapel-lang/chapel/pull/28841.diff