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

parameterized value class and tail call: crash #6891

Closed
scabug opened this issue Dec 29, 2012 · 5 comments
Closed

parameterized value class and tail call: crash #6891

scabug opened this issue Dec 29, 2012 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Dec 29, 2012

import scala.annotation.tailrec

object Foo {
  implicit class Foo[A](val x: Int) extends AnyVal {
    def bippy() = {
      @tailrec def loop(x: A): Unit = loop(x)
      ()
    }
  }
  // uncaught exception during compilation: Types$TypeError("type mismatch;
  //  found   : A(in method bippy$extension)
  //  required: A(in class Foo)") @ scala.tools.nsc.typechecker.Contexts$Context.issueCommon(Contexts.scala:396)
  // error: scala.reflect.internal.Types$TypeError: type mismatch;
  //  found   : A(in method bippy$extension)
  //  required: A(in class Foo)
}
@scabug
Copy link
Author

@scabug scabug commented Dec 29, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6891?orig=1
Reporter: @paulp
Affected Versions: 2.10.0
See #6482, #6574

@scabug
Copy link
Author

@scabug scabug commented Jan 9, 2013

@retronym said:
See the fix of #6482 for some inspiration.

Diagnosis and a first cut at a fix:

https://github.com/retronym/scala/compare/ticket/6891

I've posed some questions in the commit comment that are puzzling me.

@scabug
Copy link
Author

@scabug scabug commented Jan 19, 2013

@retronym said:
I think I can see the correct fix for this.

Wish me luck: https://scala-webapps.epfl.ch/jenkins/job/scala-checkin-manual/755/console

@scabug
Copy link
Author

@scabug scabug commented Jan 19, 2013

@paulp said:
Alas, poor retronym, we knew him well.

@scabug
Copy link
Author

@scabug scabug commented Jan 20, 2013

@retronym said:
Back from the brink:

scala/scala#1936

@scabug scabug closed this Jan 29, 2013
@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants