aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2015-10-25 15:54:12 +0100
committerGuillaume Martres <smarter@ubuntu.com>2015-10-25 15:54:12 +0100
commit08df804a5b4b7289a1518aa5ccf9753ec1a8cd7a (patch)
tree94cc2597ae3763ed8d540646209864f0b67d9612 /tests/pos
parentecf62cf18b43b5a39e973bdc8087675a24337ce0 (diff)
parent875d7da572b2367222e3021edcecb2d3cb33cefa (diff)
downloaddotty-08df804a5b4b7289a1518aa5ccf9753ec1a8cd7a.tar.gz
dotty-08df804a5b4b7289a1518aa5ccf9753ec1a8cd7a.tar.bz2
dotty-08df804a5b4b7289a1518aa5ccf9753ec1a8cd7a.zip
Merge pull request #863 from dotty-staging/fix/inference-methcall
Fix/inference methcall
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/tparam_inf.scala38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/pos/tparam_inf.scala b/tests/pos/tparam_inf.scala
new file mode 100644
index 000000000..16d99b75d
--- /dev/null
+++ b/tests/pos/tparam_inf.scala
@@ -0,0 +1,38 @@
+class HasFoo[T] {
+ val x: Foo[T] = ???
+}
+class Foo[T] {
+ def get(x: T): T = x
+ def get2(x: T): Nothing = ???
+
+ def foo1(x: T)(implicit ev: T): Nothing = ???
+ def foo2(x: T)(implicit ev: T): T = ???
+ def foo3[Dummy](x: T)(implicit ev: T): Nothing = ???
+ def foo4[Dummy](x: T)(implicit ev: T): T = ???
+}
+
+object Test {
+
+ def foo1[T](x: T)(implicit ev: T): Nothing = ???
+ def foo2[T](x: T)(implicit ev: T): T = ???
+
+ def test1: Unit = {
+ implicit val ii: Int = 42
+
+ foo1(10)
+ foo2(10)
+ }
+
+ def hf[T]: HasFoo[T] = ???
+ def test2: Unit = {
+ implicit val ii: Int = 42
+
+ hf.x.get(10)
+ hf.x.get2(10)
+
+ hf.x.foo1(10)
+ hf.x.foo2(10)
+ hf.x.foo3(10)
+ hf.x.foo4(10)
+ }
+}