You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deffind[A](list: List[A], elem: A) { eq: (A, A) =>Bool }:Bool= list match {
caseNil() =>falsecaseCons(head, _) and head.eq(elem) =>true// ^~~// Cannot resolve function eq, called on a value receiver.case _ =>false
}
but if you just write eq(head, elem), it Just Works ™️
I think this should be somewhat unambiguous as patterns can only be values as of right now, right?
The text was updated successfully, but these errors were encountered:
In this example, UFCS throws an error:
but if you just write
eq(head, elem)
, it Just Works ™️I think this should be somewhat unambiguous as patterns can only be values as of right now, right?
The text was updated successfully, but these errors were encountered: