-
Notifications
You must be signed in to change notification settings - Fork 562
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
Local type synonyms #3897
base: master
Are you sure you want to change the base?
Local type synonyms #3897
Conversation
a186be0
to
4068600
Compare
For things like this, I recommend using the
So the particular unification variable in the error definitely exists. The reason for the error is that The apparent complexity of
The I don't think that I'm going to guess that |
4068600
to
24135e0
Compare
@natefaubion Thank you so much! That was immensely useful. There are likely a few more edge cases that I haven't yet tested and fixed, but this is now mostly functional. |
moduleName <- unsafeCheckCurrentModule | ||
(kind', ty') <- warnAndRethrow (addHint (ErrorInTypeSynonym name) . addHint (positionedError ss)) $ do | ||
checkDuplicateTypeArguments $ map fst args | ||
traverse replaceAllTypeSynonyms . swap =<< kindOfLocalTypeSynonym moduleName (sa, name, args, ty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does there need to be an introduceSkolemScope
in here? I tried it with and without and it didn't seem to make a difference on any tests I could come up with, but it seems to be paired with all the other replaceAllTypeSynonyms
s in this file.
We need to support local synonyms in the shadowing lint for both:
|
For the first case: |
If the types work out, I say reuse it, otherwise a new one. |
Warnings have been added! Most of them were not put in the |
9b529a0
to
2a4666e
Compare
2a4666e
to
e83181d
Compare
56baea1
to
953acb5
Compare
953acb5
to
7a60917
Compare
7a60917
to
06a803a
Compare
ddfb171
to
4f80996
Compare
4f80996
to
01d8100
Compare
01d8100
to
e15414c
Compare
e15414c
to
3e2e2a1
Compare
3e2e2a1
to
84242a5
Compare
This is an implementation of #3708 (the ‘native’ implementation; I've abandoned the desugaring approach). I consider it largely if not entirely complete; there may be bugs but in a couple of years of using this atop various versions of PureScript I haven't encountered them. It's only a draft because we haven't arrived at a consensus that #3708 should be implemented.
(Previously this initial comment was a plea for help with an issue that has long since been resolved; anyone who's really curious can look through the edit history but I felt it was misleading to have that be the initial representation of this PR at the current time.)
Closes #3708.