|
|
|
|
|
by nicktelford
1855 days ago
|
|
No. It's a Singleton type, which means that instead of just being a String, it has to be exactly the String "Scala". i.e. val x: "scala" = "scala" // would compile val y: "scala" = "java" // would produce a compile error Union types are an orthogonal concept, and work as you'd expect: val z: String | Int = "foo" |
|