Skip to content

Make trees after TailRec type correct. Move Ycheck after tailrec #154

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 6 commits into from
Jul 23, 2014

Conversation

DarkDimius
Copy link
Contributor

Includes #144

If some node in tree is transformed changing the type,
the outer node could potentially also change type.

This patch implements a RetypingTreeMap that propagates those
changes until types converge. Propagation is done for tree nodes
that are able to compute their type based on their children:
Pair, Block, If, Match, CaseDef, Try, SeqLiteral, Annotated, Select.
Test for order of type parameters in recursive call
TailRec now relies on FullParameterization and uses two passes
for transformation. First one decides weather the method will
be transformed and if yes, starts rewriting calls in taill position.

Second one lifts the method body to a fully parameterized one,
correcting types.
@DarkDimius
Copy link
Contributor Author

@odersky can you please have a look on the failure?

@DarkDimius
Copy link
Contributor Author

It failed due to

Throw an exception if a deep subtype recursion is detected

check in t2399

@odersky odersky mentioned this pull request Jul 22, 2014
@DarkDimius DarkDimius merged commit e8d2733 into scala:master Jul 23, 2014
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this pull request Mar 19, 2025
Backport "fix: better error messages when an enum derives from AnyVal" 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.

2 participants