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 _
機能するのに、暗黙のクラスを含む値が機能しないのはなぜですか?
これは暗黙のクラスと関係がありますか、それとも赤いニシンであり、別の問題が発生していますか?