Created
March 15, 2014 08:09
-
-
Save dlwh/9563285 to your computer and use it in GitHub Desktop.
messing with implicit lookup
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 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