object RegexImplicits{
implicit class RegexWrapper(r: scala.util.matching.Regex) {
def matches(s: CharSequence): Boolean = r.pattern.matcher(s).find
}
def something(s:String):Boolean = s == "42"
}
import RegexImplicits._
//This errors with the message
//<console>:16: error: missing arguments for method matches in class RegexWrapper;
//follow this method with `_' if you want to treat it as a partially applied function
// "a".r.matches _
"a".r.matches _
//But this works fine...
something _
为什么something _
起作用但涉及隐式类的值不起作用?
这是否与隐式类有关,或者这是一个红鲱鱼,我遇到了不同的问题?