Created
August 18, 2013 03:46
-
-
Save shajra/6259800 to your computer and use it in GitHub Desktop.
this compiles; didn't realize package b would see implicit from package a without an explicit import
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
package implicits { | |
package a { | |
case class Foo(i: Int) | |
object FooApp extends App { | |
Foo(1).rich | |
} | |
} | |
package object a { | |
implicit class RichFoo(f: Foo) { | |
def rich = f.i | |
} | |
} | |
package b { | |
object FooApp extends App { | |
import a.Foo | |
Foo(1).rich | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment