When reading this article I came to the following syntax:
implicit val slaveCanRead: Slave HasPrivilege Read = null
The author says:
Also, please not that
Slave HasPrivilege Read
is just another notation forHasPrivilege[Slave, Read]
Keeping the example in basic scala, the example could also be
val foo: Map[String, Long] = Map()
val bar: String Map Long = Map()
I was looking for some documentation/articles that would explain this syntax but could not find any. Can someone point to the language feature which allows this syntax?
It’s really just as simple as T1 TCon T2 = TCon[T1, T2]
. It’s section 3.2.8 of the language specification.
InfixType ::= CompoundType {id [nl] CompoundType}
If the infix type ends with :
it is right associative, and otherwise it is left associative, just like methods, and mixing fixities is an error without parentheses.