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

implicit AnyVal class causes the compiler to crash with an exception #7241

Closed
scabug opened this issue Mar 11, 2013 · 2 comments
Closed

implicit AnyVal class causes the compiler to crash with an exception #7241

scabug opened this issue Mar 11, 2013 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Mar 11, 2013

The following code fails to compile:

object Test {
  implicit class As[X](val inside: X) extends AnyVal {
    def as[Y >: X]: Y = inside;
  }
}

The message says:

Exception in thread "main" scala.reflect.internal.Types$TypeError:
    type mismatch;
 found   : X
 required: Y

The compiler output is attached.

If I remove extends AnyVal it compiles fine.

@scabug
Copy link
Author

scabug commented Mar 11, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7241?orig=1
Reporter: Petr Pudlak (petrp)
Affected Versions: 2.10.0
Attachments:

  • log (created on Mar 11, 2013 12:56:49 PM UTC, 19051 bytes)

@scabug
Copy link
Author

scabug commented Mar 11, 2013

@retronym said:
Already fixed in 2.10.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants