In Scala, the syntax for selecting a type from a class is different from that of selecting anything else from a class. In that the former uses a hash as the selection operator instead of a dot. Why is that?
Example: If we have a class like so...
class Example {
type Foo = String
}
Why do we select the type from the class like this...
val example:Example#Foo = "1"
instead of like this?
val example:Example.Foo = "1"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…