-
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
Don't retypecheck erroneous arguments when fixing function #14043
Conversation
This had to be refined considerably since we had failures in scaladoc, specs2 and spire. The new test checks whether
|
@@ -75,7 +75,7 @@ class CommunityBuildTestC: | |||
// @Test def oslibWatch = projects.oslibWatch.run() | |||
@Test def playJson = projects.playJson.run() | |||
@Test def pprint = projects.pprint.run() | |||
@Test def protoquill = projects.protoquill.run() | |||
// @Test def protoquill = projects.protoquill.run() // needs to fix new type inference errors |
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.
Disabling protoquill like this is risky: we have at least one open PR which benefits highly from being tested against it (#12540 /cc @nicolasstucki), how much work do you think it would take to fix the new errors?
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.
I created a protoquill branch with workarounds for this change:
- dotty-staging/protoquill@1cc6154
- https://github.com/dotty-staging/protoquill/tree/workaroud-typing-changes-in-dotty-%2314043
It seems that it is a problem with the insert
function overloading. I will try to find a better fix.
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.
The alternative is to change the API of protoquill to avoid the problematic insert
overload as I id in zio/zio-protoquill@5ed25aa.
I suggest using dotty-staging/protoquill@1cc6154 for this PR as it is less intrusive.
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.
Thanks for looking into this, could you propose one of these changes to the author of protoquill?
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.
@deusaquilus this PR affects protoquill
. Could you have a look at the discussion above?
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.
If there's no other choice I'll begin the API-change. Probably want this to be consistent with Scala2-Quill API first since I want them to be aligned.
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.
Sorry to be a pester and ask again. Would it help the situation at all if lift
was not a macro but a regular method?
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.
I don't know. @nicolasstucki do you have an idea?
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.
From what I remember, making lift
a normal function might help.
But it feels like it should be fixed at the insert
/update
methods.
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.
I also pushed the simple workaround (dotty-staging/protoquill@1cc6154) to this PR. We can change the code in protoquill now or after merging this PR. It might be easier to modify protoquill once we have a nightly build with this change.
3f4347a
to
cc5428f
Compare
protoquill still fails in the community build. How can we best fix this? I am anxious to get this PR in since we might get other failing CB tests otherwise. Note that PR restricts what can be inferred. |
@odersky, I pushed the change fix zio/zio-protoquill@5ed25aa which is also in protoquill upstream zio/zio-quill#2379. The tests passed on my machine. This should not be a problem anymore because the ambiguous extension method signature was removed from protoquill. |
Protoquill passed. Something else failed, seems to be the issue from #14332 |
This comment has been minimized.
This comment has been minimized.
@nicolasstucki Ah, I was looking at the state before your commit. Good that this is fixed. |
I fixed the issue from #14332 here.
…On Mon, Jan 24, 2022 at 1:02 PM Nicolas Stucki ***@***.***> wrote:
Protoquill passed. Something else failed, seems to be the issue from
#14332 <#14332>
—
Reply to this email directly, view it on GitHub
<#14043 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGCKVTHH7EMGPJ2LUBB663UXU5WNANCNFSM5JMY4GXQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Martin Odersky
Professor, Programming Methods Group (LAMP)
Faculty IC, EPFL
Station 14, Lausanne, Switzerland
|
Don't retypecheck erroneous arguments when trying conversions or extensions on the function part. Generally, we should avoid typechecking untyped trees several times, this can quickly explode exponentially. Fixes scala#12941
Only count errors that lead to an error type in some subtree as unrecoverable.
This should fix the failures in spire and specs2.
Protquill had to be disabled since it exhibited deeply nested errors in a function argument that went away once an enclosing function was changed with a conversion or extension, and the full argument was completely typechecked. Retype checking large bodies of code like this was never inteneded and counts as a bug in the compiler. Unfortunately, this means that some type annotations will have to be added to protoquill to make it compiler again.
This reverts commit ea8d8b6.
Cherry-pick changes from zio/zio-protoquill@5ed25aa also present in zio/zio-quill#2379.
@smarter Can you give this a quick review? |
Don't retypecheck erroneous arguments when trying conversions or extensions
on the function part.
Generally, we should avoid typechecking untyped trees several times, this can quickly
explode exponentially.
Fixes #12941