How is this case class match pattern working?

前端 未结 1 513
Happy的楠姐
Happy的楠姐 2020-12-03 11:38

I\'ve just seen this case class in the Scala actors package:

case class ! [a](ch: Channel[a], msg: a)

And in the JavaDoc it de

相关标签:
1条回答
  • 2020-12-03 11:51

    When doing pattern matching, the Scala compiler will interpret o1 c1 o2 the same as c1(o1, o2). That's why :: works inside pattern matches too.

    0 讨论(0)
提交回复
热议问题