Skip to content

New asSeenFrom does not skolemize some types that should be skolemized #1009

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

Closed
smarter opened this issue Dec 23, 2015 · 0 comments
Closed
Assignees

Comments

@smarter
Copy link
Member

smarter commented Dec 23, 2015

#999 changed the way asSeenFrom works and it introduced a bug:

class Contra[-T]

class Foo {
  val foo: Contra[this.type] = new Contra[this.type]
}
object Test {
  def test: Unit = {
    val e1 = new Foo
    val f1: Contra[Foo] = e1.foo // error, as expected
    var e2 = new Foo
    val f2: Contra[Foo] = e2.foo // should be an error but now succeeds
  }
}

The problem is that we removed this line:

val m = if (isLegalPrefix(pre)) null else new AsSeenFromMap(pre, cls)

but asSeenFrom#toPrefix still assumes that the prefix is always legal when the map is null.

smarter added a commit to dotty-staging/dotty that referenced this issue Dec 23, 2015
smarter added a commit to dotty-staging/dotty that referenced this issue Dec 23, 2015
@smarter smarter assigned smarter and unassigned odersky Dec 23, 2015
smarter added a commit to dotty-staging/dotty that referenced this issue Dec 24, 2015
smarter added a commit to dotty-staging/dotty that referenced this issue Dec 24, 2015
@smarter smarter closed this as completed in 8d8fd26 Jan 3, 2016
odersky added a commit that referenced this issue Jan 3, 2016
Fix #1009: Do not forget to skolemize some types
DarkDimius pushed a commit to dotty-linker/dotty that referenced this issue May 9, 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

No branches or pull requests

2 participants