-
Notifications
You must be signed in to change notification settings - Fork 0
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
Context aware types in ast_tools
schema
#107
Comments
…iveContentHash`. (#5573) related to oxc-project/backlog#107
I agree that in an ideal world we'd resolve type names. But do you think that's feasible in an reasonable amount of time? And how deep do we go? Trace the chain of This seems pretty fiendish - we'd be essentially reimplementing a chunk of rustc. Is there more limited level of resolution we could do which covers 95% without being quite so fiendish? Or is there an existing crate for this? |
Or... could we prevent the problem you're pointing out by just banning defining/importing types with same names as |
I was more concerned about our restrictions on aliased use statements. I'll create an issue for tracking this suggestion in the main repo - as I don't see that part being hard to implement - but let's keep this one open in the backlog. I think we can do a simple hack for it instead of doing the whole type-system thing. If we resolve only |
I wasn't sure about it since our types aren't context-aware so for less common type names you can have code like this:
Something like
ReferenceId
isn't that crazy to be used by someone who isn't aware of this and would mess up their equality checks for good(it is always true in this example).What if we ignore the
Span
type name but use thename + type
combo for the rest? Or we can actually look at the use statements and resolve the type names, I think it would also be a welcomed change in theoxc_regular_expression
crate,Atom
in regex means something else, and our atom is usually used there asuse oxc_span::Atom as SpanAtom
, But I had to change it back toAtom
in the ast file to make the codegen recognize it.Originally posted by @rzvxa in oxc-project/oxc#5427 (comment)
The text was updated successfully, but these errors were encountered: