bug icon indicating copy to clipboard operation
bug copied to clipboard

False positive warning when returning a tuple of wildcard type

Open scabug opened this issue 8 years ago • 1 comments

Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_102).
Type in expressions for evaluation. Or try :help.

scala> val (a, b) = (getClass, getClass)
<console>:11: warning: inferred existential type (Class[?0], Class[?0]) forSome { type ?0 <: type; type ?0 <: type }, which cannot be expressed by wildcards,  should be enabled
by making the implicit value scala.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 Scaladoc for value scala.language.existentials for a discussion
why the feature should be explicitly enabled.
       val (a, b) = (getClass, getClass)
           ^
a: Class[_ <: type] = class 
b: Class[_ <: type] = class 

scabug avatar Jan 11 '17 06:01 scabug

Imported From: https://issues.scala-lang.org/browse/SI-10142?orig=1 Reporter: @Atry Affected Versions: 2.12.1

scabug avatar Jan 11 '17 06:01 scabug