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

case classes not nice towards language.existentials #6798

Closed
scabug opened this issue Dec 11, 2012 · 2 comments
Closed

case classes not nice towards language.existentials #6798

scabug opened this issue Dec 11, 2012 · 2 comments
Assignees

Comments

@scabug
Copy link

scabug commented Dec 11, 2012

Welcome to Scala version 2.10.0-RC3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_07).
Type in expressions to have them evaluated.
Type :help for more information.

scala> case class A(c: Class[_])
<console>:7: warning: inferred existential type Option[Class[_$1]] forSome { type _$1 }, which cannot be expressed by wildcards,  should be enabled
by making the implicit value language.existentials visible.
This can be achieved by adding the import clause 'import scala.language.existentials'
or by setting the compiler option -language:existentials.
See the Scala docs for value scala.language.existentials for a discussion
why the feature should be explicitly enabled.
       case class A(c: Class[_])
                  ^
defined class A

scala> object B { def x: Option[Class[_]] = null }
defined module B

My prime guess would be that the synthesized unapply method lacks a proper type ascription.

@scabug
Copy link
Author

scabug commented Dec 11, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6798?orig=1
Reporter: @rkuhn
Affected Versions: 2.10.0-RC1
Duplicates #6541

@scabug
Copy link
Author

scabug commented Dec 11, 2012

@retronym said (edited on Dec 11, 2012 4:33:36 PM UTC):
Duplicate of #6541

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