-
Notifications
You must be signed in to change notification settings - Fork 37
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
Problems with non-unit types. #1845
Comments
I think there're a couple of misunderstandings going on here:
Only units can be top-level types for parsing, so the error message is expected here. The
Parsing attributes are associated with fields, not types. If you put them into a type definition, they'll simply be ignored currently (which is a diagnostics bug: we should really have a validator giving you an error message rejecting such attributes on types). This is similar to #1812 in that regard. |
Sorry, I tried to condense my observation so much that I may have gone too far. 😄 The structure I'm really wondering about is if I can do this...
I initially tried that as Is it reasonable for me to want to write parsers with non-unit data structures? It feels to me that there are enough data structures out in the world that are effectively vectors with no outer structure that it would be supported. If it's a huge architectural problem at the moment though I'd rather just close this ticket and table it for the future. 😄 Also, I guess I have one other question, should I be dropping example scripts somewhere whenever I run across little syntax things that I think should kick out an error or kick out an error that is incorrect or misleading? Perhaps a running ticket with a checklist or something? |
Short answer: not going to happen. The unit is the basic entry point for parsing, and all the machinery has been structured around that. It also doesn't seem to be a limitation to put whatever type you want to parse into a top-level unit, so I think that's fine as is.
Just create individual tickets, it's the easiest to work through. You can mark them as "diagnostics" and "low priority" if you want (otherwise we'll probably do that :-)) |
sounds good
Will do! Thanks. |
Whoops. |
Dammit. |
I seem to be having some trouble with defining any types that aren't units.
Problems still persists if my public type is a unit but I'm using one of these non-unit types within it.
If I provide a length where the
X
type is getting used then it works, but that doesn't seem like desired behavior.The text was updated successfully, but these errors were encountered: