diff options
author | odersky <odersky@gmail.com> | 2015-10-07 15:07:28 +0200 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2015-10-07 15:07:28 +0200 |
commit | 8532c98672e6dcde4d350f253b46892cc0ece34c (patch) | |
tree | b834f8e32776b62c0224607e1664f65f39893108 /tests | |
parent | a8c8bdad57941071b85caa54bc57b84d8ca7d526 (diff) | |
parent | 22a2c79adf3acb8b5dd341b552e499bced58c537 (diff) | |
download | dotty-8532c98672e6dcde4d350f253b46892cc0ece34c.tar.gz dotty-8532c98672e6dcde4d350f253b46892cc0ece34c.tar.bz2 dotty-8532c98672e6dcde4d350f253b46892cc0ece34c.zip |
Merge pull request #799 from dotty-staging/change-inference
Change inference
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/i739.scala | 7 | ||||
-rw-r--r-- | tests/pos/i739.scala | 17 | ||||
-rw-r--r-- | tests/run/liftedTry.scala | 3 |
3 files changed, 25 insertions, 2 deletions
diff --git a/tests/neg/i739.scala b/tests/neg/i739.scala new file mode 100644 index 000000000..5385fa42c --- /dev/null +++ b/tests/neg/i739.scala @@ -0,0 +1,7 @@ +class Foo[A, B] +class Test { + implicit val f: Foo[Int, String] = ??? + def t[A, B >: A](a: A)(implicit f: Foo[A, B]) = ??? + t(1) // error +} + diff --git a/tests/pos/i739.scala b/tests/pos/i739.scala new file mode 100644 index 000000000..61fed4e5d --- /dev/null +++ b/tests/pos/i739.scala @@ -0,0 +1,17 @@ +class Foo + +object Test { + def foo[T](x: T)(implicit ev: T): T = ??? + + class Fn[T] { + def invoke(implicit ev: T): T = ??? + } + + def bar[T](x: T): Fn[T] = ??? + + def test: Unit = { + implicit val evidence: Foo = new Foo + foo(new Foo) + bar(new Foo).invoke + } +} diff --git a/tests/run/liftedTry.scala b/tests/run/liftedTry.scala index 5ff4add6d..ff9af98ec 100644 --- a/tests/run/liftedTry.scala +++ b/tests/run/liftedTry.scala @@ -12,7 +12,7 @@ object Test { foo(try 3 catch handle) - def main(args: Array[String]): Unit = { + def main(args: Array[String]) = { assert(x == 1) assert(foo(2) == 2) assert(foo(try raise(3) catch handle) == 3) @@ -20,7 +20,6 @@ object Test { } } - object Tr { def fun(a: Int => Unit) = a(2) def foo: Int = { |