forked from chapel-lang/chapel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dyno: Fix constness error for unpacked tuple assignment (chapel-lang#…
…24761) This PR resolves a bug where the frontend was issuing a constness error for statements like ``(a, b, c) = foo();``. The error originated from an attempt to resolve an assignment operator between the tuple literal ``(a, b, c)`` and the returned tuple from ``foo()``. The LHS naturally accepts a ``ref``, which is not compatible with a tuple literal. The Resolver has already taken responsibility for implementing this case, so resolving the assignment would be incorrect. This PR avoids resolving the assignment altogether. A new helper function, ``buildStdContext()``, is added to the ``test-common.h`` header. This function returns a ``unique_ptr`` to a Context that has been configured to load the standard modules. Use of the standard modules in this instance was necessary to expose the issue when trying to resolve the assignment operator defined in ``ChapelTuple``. [reviewed-by @DanilaFe]
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters