Skip to content

Instantly share code, notes, and snippets.

@hubertp
Created March 2, 2012 15:46
Show Gist options
  • Save hubertp/1959255 to your computer and use it in GitHub Desktop.
Save hubertp/1959255 to your computer and use it in GitHub Desktop.
code that triggers inferExprAlternative
trait Base[T]
trait Foo[T] extends Base[T] {
}
object Impl {
implicit def f[Z](a: Foo[Z]): Result = null
implicit def f[Z](a: Base[Z]): Result = null
}
//import Impl._
trait Result
object Foo {
def apply[T](a: Int = 0): Base[T] = new Foo[T]{}
def apply[T]: Foo[T] = new Foo[T]{}
}
object Test {
def test[T]: Base[T] = Foo[T]
// def test[T]: Result = Foo[T]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment