1
如果我想讓該參數爲隱式,如何使用類型註釋函數文字的參數?使用類型註解函數文字的隱含參數
trait Test { def call[C, T](fun: C => T): T }
def test1(t: Test): Unit =
t.call { c: Int => 33 } // ok
def test2(t: Test): Unit =
t.call { implicit c => 33 } // type missing...
def test3(t: Test): Unit =
t.call { (implicit c: Int) => 33 } // not possible...
好消息,期待2.9.0.final! – 2011-04-04 16:32:09