Skip to content

Match Type documentation example does not compile #5625

Closed
@joshlemer

Description

@joshlemer

The following example from the dotty website does not compile:

http://dotty.epfl.ch/docs/reference/match-types.html
EDIT: new location of docs are here https://dotty.epfl.ch/docs/reference/new-types/match-types.html

scala>    type LeafElem[X] = X match {                                                                                                                                                                                                        
     |     case String => Char
     |     case Array[t] => LeafElem[t]
     |     case Iterable[t] => LeafElem[t]
     |     case t <: AnyVal => t
     |   }
5 |    case t <: AnyVal => t
  |           ^^
  |           '=>' expected, but '<:' found

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions