Skip to content

Try/hygienic desugaring #88

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 5 commits into from
Mar 21, 2014
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 20, 2014

I took care of the reviewers comments. There's a stray commit here to fix language imports. I was sort of sure I had submitted that before and it got merged in, but it seems that was not the case.

@odersky
Copy link
Contributor Author

odersky commented Mar 20, 2014

@review and sheparding by @gzm0

I think everyone agreed that the commits should go in. The question is just whether

dotty-staging@1788368

should go somewhere else. If it's not already committed, I'd say leave it here, because it's an uncontroversial commit.

@DarkDimius
Copy link
Contributor

dotty-staging@1788368
is already incorporated into previous commits

@gzm0
Copy link
Contributor

gzm0 commented Mar 20, 2014

dotty-staging/dotty-1@1788368 only has a comment after the rebase. If that is what it should be, I'll alter the commit message.

@gzm0
Copy link
Contributor

gzm0 commented Mar 20, 2014

LGTM except for the comments in the test. @odersky if it's ok, I'll clean those up a bit.

@DarkDimius
Copy link
Contributor

@gzm0 the comment is already there.

@gzm0
Copy link
Contributor

gzm0 commented Mar 20, 2014

Indeed. I'll drop this commit then.

odersky and others added 5 commits March 20, 2014 20:25
Adds a new scheme by which a TypeTree() can refer for its type to the symbol of some other type.
Applies the scheme to setter parameters, replacing the previous ad-hoc solution.
To get truly hygienic desugared trees, we need a derived type tree scheme that's more
flexible than just the previous two choices of info-of-symbol and typeref-of-symbol.
The new scheme based on DerivedTypeTrees allows arbitrary methods to derive the type tree's type.
Made desugaring hygienic. Trees that are derived from some other tree are no longer stored as simple
untyped Ident trees, but as TypeTrees that know how to derive their types from some other type.

Test cases in pos: hygiene.scala, t0054.scala and t0085.scala.

The comment in hygiene.scala points to the difficulties we are facing. In particular, we need type
trees that can rebind some references of a source type to local occurrences with the same name. t0054.scala is similar to hygiene.scala. t0085.scala is trickier, but also related. Essentially the problem there is that we have a class
that inherits its outer class. In this case it is important to resolve an identifier in the right context. The identifier added to the copy method of a case class must be resolved outside the class (just like the same
identifier in the constructor of that case class).
@gzm0
Copy link
Contributor

gzm0 commented Mar 20, 2014

IMHO this can be merged as soon as CI passes.

@gzm0 gzm0 mentioned this pull request Mar 21, 2014
odersky added a commit that referenced this pull request Mar 21, 2014
@odersky odersky merged commit fd76c38 into scala:master Mar 21, 2014
OlivierBlanvillain pushed a commit to OlivierBlanvillain/dotty that referenced this pull request Dec 12, 2016
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this pull request Mar 19, 2025
Backport "Remove tvars introduced while testing normalizedCompatible" 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.

3 participants