I use “λ” as name of a case class:
object O:
case class λ(value: Any) { def asSymbol = value.asInstanceOf[Symbol] }
import O.*
But when I put it between square brackets List[λ]
it leads to error:
scala> λ(List(λ(Symbol("a")))) match { case λ(xs: List[λ]) => xs.map(_.asSymbol) }
-- [E008] Not Found Error: -----------------------------------------------------
1 |λ(List(λ(Symbol("a")))) match { case λ(xs: List[λ]) => xs.map(_.asSymbol) }
| ^^^^^^^^^^
| value asSymbol is not a member of λ
1 error found
The way out is to qualify λ
as O.λ
. I know λ
is used in type names like |
or &
are in union or intersection types.
Can it not be reconciled except as O.λ
?