Skip to content

Instantly share code, notes, and snippets.

@dlwh
Created March 15, 2014 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlwh/9563285 to your computer and use it in GitHub Desktop.
Save dlwh/9563285 to your computer and use it in GitHub Desktop.
messing with implicit lookup
package foo {
class Bar
object Bar {
implicit val b = new Bar
}
}
import foo.Bar
class Vector(implicit bar: Bar)
trait Lookup[T]
object Vector extends Lookup[Bar] {
}
class Matrix(implicit bar: Bar)
object Matrix extends Lookup[Bar] {
}
object Main {
def foo(a: Vector, b: Matrix)(implicit bar: Bar) = ???
foo(new Vector, new Matrix)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment