Skip to content

Instantly share code, notes, and snippets.

@arkadius
Created August 4, 2015 20:47
Show Gist options
  • Save arkadius/70c97f4ac2b0a338913f to your computer and use it in GitHub Desktop.
Save arkadius/70c97f4ac2b0a338913f to your computer and use it in GitHub Desktop.
class A()
class B(val a: A)
class C(val b: B)
implicit def aToB(a: A) = new B(a)
implicit def sthConvertibleToBToC[T <% B](t: T): C = new C(t)
def doSthWithC[T <% C](t: T) = t.b
doSthWithC(new A)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment