Skip to content

False positive warning when returning a tuple of wildcard type #10142

Open
@scabug

Description

@scabug
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 

Metadata

Metadata

Assignees

No one assigned

    Labels

    existentialfixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)infer

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions