-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
typetraits: improve
genericParams
(#1347)
## Summary The `genericParams` typetrait now also supports `ref`, `var`, `ptr`, and `range`. In addition, it's fully based on type information, making it work regardless of what expression is used as the argument. For `array` types, the index type is now *always* a `range` type, so this is a **breaking change**. ## Details The main goal is removing the mixed analysis from `genericParams`, where both type and normal AST were inspected. Besides only working for some type expressions, this also relied on `sem` modifying the input AST nodes' types in type AST, making the macro susceptible to breaking when analysis of type AST changes in `sem`. To make the implementation not rely on `sem` implementation details, `genericParams` now only uses the macro type API, also removing the need for an intermediate macro. The syntax convenience of specifying an array's index type with a single integer value does not exist at the type level, and a `StaticParam[x]` is therefore not returned for `array` types anymore.
- Loading branch information
Showing
2 changed files
with
46 additions
and
61 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