Navigation Menu

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

Cannot create a PartialFunction object in a specialized context #8633

Open
scabug opened this issue May 29, 2014 · 2 comments
Open

Cannot create a PartialFunction object in a specialized context #8633

scabug opened this issue May 29, 2014 · 2 comments

Comments

@scabug
Copy link

scabug commented May 29, 2014

import scala.util.control._
class Foo[@specialized T] {
  def foo(x: T) = {
    val eh: PartialFunction[Throwable, Unit] = {
      case NonFatal(t) => ()
    }
  }
}

reports an error:

[error]  found   : x1.type (with underlying type Throwable)
[error]  required: A1
[error]     val eh: PartialFunction[Throwable, Unit] = {

Removing the @specialized annotation, or putting the expression into a non-specializable method makes the error go away.

@scabug
Copy link
Author

scabug commented May 29, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8633?orig=1
Reporter: @axel22
Affected Versions: 2.11.0

@scabug
Copy link
Author

scabug commented Jul 1, 2014

@VladUreche said:
Fixed in miniboxing:
miniboxing/miniboxing-plugin@8529025

[the patch can be easily ported, but since specialization is becoming deprecated, I won't invest the time in this patch]

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