Skip to content

headOption method does not compile for some Array[Nothing] #10590

@Atry

Description

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

scala> Array.empty.headOption // OK
res0: Option[Nothing] = None

scala> val emptyArray = Array.empty
emptyArray: Array[Nothing] = Array()

scala> emptyArray.headOption // Does not compile
<console>:13: error: value headOption is not a member of Array[Nothing]
       emptyArray.headOption // Does not compile
                  ^

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions