我有以下代码:
def bigger[T <% Ordered[T]](compare: T)(a: ResultSet, columnName: String): Boolean =
a.getObject(columnName).asInstanceOf[T] > compare
var rules = List[(ResultSet,String) => Boolean]()
rules += bigger[Int](1000) //doesn't work, compile error
val rule = bigger(1000) _ _
rules += rule //still doesn't work, compile error
我需要更改什么才能使其正常工作?
答案 0 :(得分:2)
您只需使用一个_
并使用+:=
向rules
添加元素:
rules +:= bigger[Int](1000) _