Skip to content

Fix #1443: Replace toplevel TypeBounds with Any #1450

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 1 commit into from
Aug 15, 2016

Conversation

cswinter
Copy link
Contributor

Is there a way to give a full path for "Any" that cannot be shadowed? I've not actually managed to come up with a situation where this would matter, but my current solution still seems inadequate.
Review by @smarter.

@odersky
Copy link
Contributor

odersky commented Aug 12, 2016

_root_.scala.Any should be safe enough.

@cswinter cswinter force-pushed the elim-toplevel-typebound branch from f8ad4fe to c201dec Compare August 12, 2016 15:28
findWildcardType(t) match {
case Some(wildcardPos) =>
syntaxError("unbound wildcard type", wildcardPos)
Select(Select(Ident(Names.termName("_root_")), Names.termName("scala")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of Names.termName and Names.typeName you should use the names already defined in StdNames: nme.ROOTPKG, nme.scala_ and tpnme.Any.

Copy link
Contributor

@odersky odersky Aug 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cswinter Have a look at the definition of scalaUnit in untpd. I propose to model a scalaAny like this instead of writing things out in the parser.

@smarter
Copy link
Member

smarter commented Aug 13, 2016

/rebuild

@cswinter cswinter force-pushed the elim-toplevel-typebound branch from c201dec to b029894 Compare August 15, 2016 08:27
@smarter
Copy link
Member

smarter commented Aug 15, 2016

LGTM!

@smarter smarter merged commit 3179b03 into scala:master Aug 15, 2016
@smarter smarter removed the reviewed label Aug 15, 2016
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.

4 participants