Skip to content

Instantly share code, notes, and snippets.

@shajra
Created August 18, 2013 03:46
Show Gist options
  • Save shajra/6259800 to your computer and use it in GitHub Desktop.
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
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