Simon Schäfer
unread,Apr 15, 2013, 8:02:19 PM4/15/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scala-l...@googlegroups.com
The following example compiles successfully:
case class ~[-A, B]
class X[+A, +B] {
def x[B1 >: B](implicit ev: A ~ B1) = ???
}
as well does this:
case class ~[A, B]
class X[+A, +B] {
def x[A1 >: A, B1 >: B](implicit ev: A1 ~ B1) = ???
}
The second example compiles as well when A in ~ is contravariant:
case class ~[-A, B]
class X[+A, +B] {
def x[A1 >: A, B1 >: B](implicit ev: A1 ~ B1) = ???
}
In the last example, does it matter if A1 exists? I think it is
unnecessary because for method x the lower bound A1 >: A and the type
declaration -A mean the same.