diff options
author | Martin Odersky <odersky@gmail.com> | 2016-03-09 18:34:31 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-03-09 18:35:03 +0100 |
commit | 7dfab5f427ad9600b8e54b61716461787d7fa4a1 (patch) | |
tree | be29d0130d3c2d549993606d7e563b8c5621769e /tests/neg | |
parent | f63110edc7ab8299ef1cd33b2b156e7987e35931 (diff) | |
download | dotty-7dfab5f427ad9600b8e54b61716461787d7fa4a1.tar.gz dotty-7dfab5f427ad9600b8e54b61716461787d7fa4a1.tar.bz2 dotty-7dfab5f427ad9600b8e54b61716461787d7fa4a1.zip |
Refine pretypeArgs
It worked more or less by accident before. Now it's more complicated,
but we also have tests.
Diffstat (limited to 'tests/neg')
-rw-r--r-- | tests/neg/overloaded.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/neg/overloaded.scala b/tests/neg/overloaded.scala new file mode 100644 index 000000000..ce971ebcf --- /dev/null +++ b/tests/neg/overloaded.scala @@ -0,0 +1,17 @@ +// testing the limits of parameter type inference + +object Test { + def mapX(f: Char => Char): String = ??? + def mapX[U](f: U => U): U = ??? + mapX(x => x) // error: missing parameter type + + def foo(f: Char => Char): Unit = ??? + def foo(f: Int => Int): String = ??? + foo(x => x) // error: missing parameter type + + def bar(f: (Char, Char) => Unit): Unit = ??? + def bar(f: Char => Unit) = ??? + bar((x, y) => ()) + bar (x => ()) + +} |