Skip to content

Fix/catch non fatal #285

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

Merged
merged 4 commits into from
Dec 17, 2014
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 14, 2014

Catch NonFatal(ex) instead of Throwable. The change exhibited the problem in #226 that UnApply was not handled. This is now also fixed. review by @olhotak

Closes #226

@olhotak
Copy link
Contributor

olhotak commented Dec 14, 2014

This helps with #226 partially, but if I put an empty ReTyper after FirstTransform, every UnApply results in the error: error: missing arguments for method unapply in object ...

The problem is in val unappType = typed(tree.fun): it does not supply a prototype to typed(). adaptInterpolated then calls adaptNoArgs instead of adaptToArgs, causing the error. To make it call adaptToArgs, we would need a FunProto. The logic for making an UnapplyFunProto in the other typedUnApply is quite complicated. Should we factor it out and use it in both typedUnApplys?

For testing/debugging, I've created a branch https://github.com/olhotak/dotty/tree/retyper-check that just runs a ReTyper after FirstTransform.

The method is needed to be able to survive ReTypers between frontend and
pattern matching.
Previously, stackoverflows led to infinite loops because the catch
immediately threw another stack overflow. Anyway, one should never
catch Throwable.
Change exhibits a problem in the transformers: pattern matching try's
do not seem to be handled.
@odersky
Copy link
Contributor Author

odersky commented Dec 15, 2014

The typecheck for UnApply nodes was very much incomplete. I changed the code to be simply a hook which retypers need to override. This showed another problem: UnApply nodes in catches make it to Erasure, and then blow up with an unhandled UnApply. Reassigning to @DarkDimius for a fix.

@DarkDimius
Copy link
Contributor

I'm triggering retesting on travis.

DarkDimius added a commit that referenced this pull request Dec 17, 2014
@DarkDimius DarkDimius merged commit ecbf5f5 into scala:master Dec 17, 2014
tgodzik added a commit to tgodzik/scala3 that referenced this pull request Apr 29, 2025
Backport "Rename on import is never wildcard" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

typeUnadapted/typedUnnamed missing case for UnApply
3 participants