-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template literal type printing #188
Comments
Hello @kaleidawave, next I am working on this. ezno/checker/specification/specification.md Lines 4079 to 4094 in d67cd1b
When implementing type expansion in template literals, this case fails, but how far do you expect to expand?
Current implementation is Option 3 #218 (draft) |
Awesome! Yes I like option 3 as it has the most information. (is there any difference between 2 and 3?). It is fine to modify the specification if it is just a printing difference etc. |
It is simply a question of how deep to search, so if Option 3 is fine, this seems to be the way to go! Incidentally, this is how this case currently works, but it is also supposed to be deployed, right?
|
Yep I think that is fine. I am split on whether to print the name vs the value of an alias. I think it currently easiest to just print the name. |
OK, so I'm going to Open the PR as it is for now! |
At the moment the template literal type
`Hi${string}`
is printed atstring
(as that is its base type).There should be special logic to pick up the type
Constructor::BinaryOperation { lhs, rhs, operation: MathematicalAndBitwise::Addition }
and then form a chain ofparts: Vec<(String, TypeId)>, trailing: String
using recursive type traversal. If it looks like a template literal type (aka no number + number) then it can be printed like on (see example in parser)It should be added around here
ezno/checker/src/types/printing.rs
Lines 254 to 281 in e6f6ffd
The text was updated successfully, but these errors were encountered: