Scala 2.8: _ behaviour changed?

Posted by Alexey Romanov on Stack Overflow See other posts from Stack Overflow or by Alexey Romanov
Published on 2010-04-29T07:24:21Z Indexed on 2010/04/29 7:27 UTC
Read the original article Hit count: 359

Filed under:

Using XScalaWT, this compiled under Scala 2.7:

class NodeView(parent: Composite) extends Composite(parent) {
  var nodeName: Label = null

  this.contains(
    label(
      nodeName = _
    )
  )
}

With 2.8.0 RC1, I get this error:

type mismatch; found : main.scala.NodeView required: org.eclipse.swt.widgets.Label

The types are:

label(setups: (Label => Unit)*)(parent: Composite) : Label
contains(setups: (W => Unit)*) : W

So it looks like _ now binds to the outer function instead of inner.

Is this change intentional?

© Stack Overflow or respective owner

Related posts about scala-2.8