-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
First pass of combining multiple union types #20014
Conversation
3a54961
to
9e6b993
Compare
Ok - I initially thought that was just my local setup being weird. |
I've signed the CLA now. |
I think we probably need to go deeper. I would expect a fix to do some changes to mergeIfSuper, or else directly in lub. Or maybe in simplify. Fiddling with typedType clashes with the way things are done elsewhere. |
Looking at the routes to the sections your referencing ( I did have a poke at |
I played some more with it and think I have a solution in #20027. Interestingly the problem got fixed by removing some code. |
I should check my notifications more often. |
Thank you very much for investing this issue! Your time and effort were truly appreciated by us. Although the issue was resolved before you had the chance to find the solution, your insights are always welcome, and we would like you to continue participating in this project. |
I've worked with some much simpler compilers before, thought it was about time I made an attempt at something on a more serious scale.
I had an alternate attempt to address this via an extra case within TypeOps, but that seemed to have significantly more ripple effects than I was anticipating.
Avoided using a traditional set for comparisons such that I could maintain a guarantee of ordering based on the order at the inputs. The output order is deterministic for a given input type, but I have not aimed for consistency between conceptually similar types.
My understanding is that by limiting this to inferred types, it should only impact a type that is not user provided, so use cases where a user wants a non-impactful type can be maintained through compilation.
Would likely want to expand this to cover and types as well as or types in the same code.
I'm fully expecting to be ripped apart on performance, but the big win I had spotted was to make sure I was not using subset relations between OrTypes, as that appears to be expensive.
Expecting that there's still more to do here, but keen to get back into real code again, so any feedback would be very welcome