Last active
July 26, 2017 14:20
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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