Real life examples of Scala infix types

后端 未结 3 1921
南方客
南方客 2021-01-03 06:36

I\'ve found one interesting syntax stuff. It\'s called Infix type.

Example:

class M[T, U]
new (Int M String)

And now I

3条回答
  •  天命终不由人
    2021-01-03 07:17

    From scala language, generalized type constraints

    =:=  =>  A=:=String => A must be String
    <:<  =>  A<: A must be subtype of String
    

提交回复
热议问题