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.
Implement copyability and assignability primitives in dyno (chapel-la…
…ng#24058) Implement `PRIM_IS_COPYABLE`, `PRIM_IS_CONST_COPYABLE`, `PRIM_IS_ASSIGNABLE`, and `PRIM_IS_CONST_ASSIGNABLE` in Dyno. Logic is directly ported from the implementation of these in `preFold.cpp` in the production compiler. Queries instead of flags are used to cache computed results for composite types. The primitives are defined in Dyno to return `false` for non-fully-defaulted generic composite types, and production behavior is changed (from an unclear error previously) to match. Also includes simplifying the production tests of these primitives, so it was easier to identify cases to test in Dyno. Future work: - Create and use an iterator for `TupleType`'s element types. Similarly for `ResolvedFields` if desired, maybe not if not used elsewhere. - Gracefully handle resolving an `init=` or `=` that contains a `compilerError` (treat it as not an option for the logic of copyability/assignability). - Handle `isDefaultInitializable` on non-fully-defaulted generic composite types. Probably should be handled similarly to what we do with these for copyability/assignability. It looks like it already tries to do so but errors when I try it. - If desired, get both copyable and assignable information in a single query, expanding `CopyableAssignableInfo` to contain both at once. This would probably only be desirable if we have other queries that also involve test-resolving an `init=` and `=`, see [discussion](chapel-lang#24058 (comment)). [reviewed by @mppf , thanks!] Testing: - [x] dyno tests - [x] paratest
- Loading branch information
Showing
35 changed files
with
906 additions
and
516 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
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
Oops, something went wrong.