Skip to content

Don't allow redefinition of core classes #1717

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
Nov 16, 2016

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 16, 2016

Fixes #1688. Review by @felixmulder

@odersky odersky mentioned this pull request Nov 16, 2016

object Null // error

class AnyVal // error
Copy link
Contributor

@felixmulder felixmulder Nov 16, 2016

Choose a reason for hiding this comment

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

This gets through compilation and prints 5:

object scala {
  trait Boolean {
    def x: Int
  }
}

object Test {
  def x: scala.Boolean = new scala.Boolean { val x = 5 }

  def main(args: Array[String]): Unit = println(x.x)
}

Not sure if the first object lands in <root> or <empty>

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed in person - this is fine because reasons (where reasons == bootstrap)

Copy link
Contributor

@felixmulder felixmulder left a comment

Choose a reason for hiding this comment

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

LGTM :)

@dottybot dottybot removed the reviewed label Nov 16, 2016
@odersky odersky merged commit 0397af7 into scala:master Nov 16, 2016
@allanrenucci allanrenucci deleted the fix-#1688 branch December 14, 2017 16:59
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