You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#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
Module code
Expected vs actual schema:
The text was updated successfully, but these errors were encountered: