http://sassa-nf.livejournal.com/ ([identity profile] sassa-nf.livejournal.com) wrote in [personal profile] juan_gandhi 2013-01-24 12:56 pm (UTC)

переписываем, чтобы не было путаницы с X
    implicit def safeCast[Z,Y, _ >: Z <: Y]( z:Z ):Y = z.asInstanceOf[Y]
    case class L[X](val x: X) { def double[_ >: X <: Int] = x*2 }

safeCast is not a valid implicit value for L.this.x.type => ?{val *: ?} because:
incompatible: (z: X)X does not match expected type L.this.x.type => ?{val *: ?}
safeCast is not a valid implicit value for => L.this.x.type => ?{val *: ?} because:
incompatible: (z: X)X does not match expected type => L.this.x.type => ?{val *: ?}

а почему он говорит (z: X)X? Это он о чём? Что Z и Y ему одним типом кажутся в том контексте?

Ок, поспрашиваю.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting