[Chapel Merge] Prevent an infinite recursion in compiler/next

Branch: refs/heads/main
Revision: e858449
Author: bradcray
Link: Prevent an infinite recursion in compiler/next by e-kayrakli · Pull Request #18886 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #18886 from e-kayrakli/poi-fix

Prevent an infinite recursion in compiler/next

[developed by @e-kayrakli , reviewed by me]

This prevents a potential infinite recursion introduced by #18877.

The compiler complains about it on darwin with CHPL_DEVELOPER.

[editors note: I didn't really spend any time reviewing this other than saying "looks like code!" but did verify that it made my Mac build work again, and didn't fail testing (not surprising given that we're not testing compiler/next].

Modified Files:
M compiler/next/include/chpl/resolution/scope-types.h

Compare: https://github.com/chapel-lang/chapel/compare/3410e576ad9e...e858449fc13c