Skip to content

Instantly share code, notes, and snippets.

@Jasper-M
Last active July 26, 2017 14:20
Show Gist options
  • Save Jasper-M/96ca24e8d2aa6160159abe2c4f745206 to your computer and use it in GitHub Desktop.
Save Jasper-M/96ca24e8d2aa6160159abe2c4f745206 to your computer and use it in GitHub Desktop.
Giving an implicit scope to an abstract type member that erases to Object
sealed trait FooImplicitScope
object FooImplicitScope {
implicit def Foo2String(f: Module.Foo): String = f.toString
implicit def Foo2Int(f: Module.Foo): Int = f.##
}
object Module {
private[Module] type A
type Foo <: A with FooImplicitScope
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment