当我遇到一段对我来说没有意义的代码时,我正在经历这本精彩的书
Programming in Scala:
def above(that: Element): Element = { val this1 = this widen that.width val that1 = that widen this.width elem(this1.contents ++ that1.contents) }
注2和3:
val this1 = this widen that.width
看来我应该可以用以下代替:
val this1 = this.widen that.width
但是,当我尝试编译此更改时,会出现以下错误:
error: ‘;’ expected but ‘.’ found.
val this1 = this.widen that.width
^
为什么这种语法不可接受?