Branch: refs/heads/main
Revision: a9cf28704ce4bd9a133489496733b84921250f13
Author: riftEmber
Link: Fix dyno range literal resolution bug by riftEmber · Pull Request #24828 · chapel-lang/chapel · GitHub
Log Message:
Fix dyno range literal resolution bug (#24828)
Fix an error message observed in testInteractive --std
for some codes
that include a range literal.
This occurred due to the Resolver
looking up the existence of
ChapelRange._range
AST as a way of checking if the standard library is
available before proceeding with range resolution. However, this can get
hit before the ChapelRange
module is resolved, such as when a range is
used as an argument to a method on another type (e.g., slicing). The
idToAstQuery
for ChapelRange._range
fails, and that stored result is
used later when the _range
AST does exist and we need to get it.
Fixed by replacing the AST existence check with a call to
CompositeType::isMissingBundledRecordType
, plus fixing the name of the
type (range
->_range
) in that method. While there, also removed a
TODO in Resolver::exit(Range*)
to resolve a call to
chpl_build_*_range
rather than manually instantiating the _range
record, which was done in
dyno: resolve range literals using `chpl_build_*_range`. by DanilaFe · Pull Request #24816 · chapel-lang/chapel · GitHub.
Credit to @DanilaFe for the fix.
Resolves https://github.com/Cray/chapel-private/issues/6151.
[reviewed by @DanilaFe , thanks!]
Testing:
- dyno tests
- paratest
Diff:
M frontend/lib/resolution/Resolver.cpp
M frontend/lib/types/CompositeType.cpp
https://github.com/chapel-lang/chapel/pull/24828.diff