Skip to content
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

evalOnce should pack the type it uses for the tpt of a valdef #3960

Closed
scabug opened this issue Oct 26, 2010 · 2 comments
Closed

evalOnce should pack the type it uses for the tpt of a valdef #3960

scabug opened this issue Oct 26, 2010 · 2 comments
Assignees

Comments

@scabug
Copy link

scabug commented Oct 26, 2010

revealed during Paul's resurrection of the tree checkers

this fails to -Ycheck:typer

class A {
  class C[x]
  val cs = new scala.collection.mutable.HashMap[C[_], Int]
  def c: C[_] = error("")
  val eval: C[_] = c
  cs(c) += 1
}

the problem is the synthetic val ev$$1: C[_$$2] = c that's generated, where C[_$$2] is unpacked since it just reuses the type of the tree c.

@scabug
Copy link
Author

scabug commented Oct 26, 2010

Imported From: https://issues.scala-lang.org/browse/SI-3960?orig=1
Reporter: @adriaanm

@scabug
Copy link
Author

scabug commented Jul 3, 2011

Commit Message Bot (anonymous) said:
(extempore in r25225) evalOnce needs to pack the type before using it on new valdefs
to avoid existential mismatches. Closes #3960, review by moors.

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