generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add type aliases, refactor go schema parsing (#1493)
#1238 Adds the ability to declare type aliases in modules ``` //ftl:typealias type UserId string ``` There is a lot of overlap between typealiases and enums. They both redefine an existing type as a new type, and therefore need to make sure our schema parsing does not skip this defined type by looking at the underlying type. There were also issues if implicit exports, enum cases (and more?) were encountered in the ast tree before we found the typealias or enum definition. This PR solves that by doing an initial pass just to find all typealias and enum declarations for the module and then doing the normal pass. Previously typealiases were allowed without any declaration but they would just fall back to the underlying type. This PR makes this an error as we do not know if this type should be an enum or a type alias. We may want to discuss this more. fixes #1475 #1476 #1477 #1492 #1449
- Loading branch information
Showing
34 changed files
with
1,479 additions
and
642 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
Oops, something went wrong.