diff options
author | Martin Odersky <odersky@gmail.com> | 2016-12-04 15:55:33 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-12-17 18:34:27 +0100 |
commit | d5ff7e052f4c321e3089e0543617f81416e4aed4 (patch) | |
tree | fdbe5b7aaeff10b7cda8945e0eb87d894855d6cc /tests/pending/run/implicitFuns.scala | |
parent | aecfb37919291f3d191aa3c04f753cc2df4d962a (diff) | |
download | dotty-d5ff7e052f4c321e3089e0543617f81416e4aed4.tar.gz dotty-d5ff7e052f4c321e3089e0543617f81416e4aed4.tar.bz2 dotty-d5ff7e052f4c321e3089e0543617f81416e4aed4.zip |
Fix erasure of implicit functions
and check at runtime that it works
Diffstat (limited to 'tests/pending/run/implicitFuns.scala')
-rw-r--r-- | tests/pending/run/implicitFuns.scala | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/pending/run/implicitFuns.scala b/tests/pending/run/implicitFuns.scala new file mode 100644 index 000000000..1b7ca694a --- /dev/null +++ b/tests/pending/run/implicitFuns.scala @@ -0,0 +1,32 @@ +object Test { + def main(args: Array[String]) = { + + implicit val world: String = "world!" + + val i1 = (implicit (s: String) => s.length > 2) + val i2 = {implicit (s: String) => s.length > 2} + + assert(i1) + assert(i2) + + val x: implicit String => Boolean = { implicit (s: String) => s.length > 2 } + + val xx: implicit (String, Int) => Int = implicit (x: String, y: Int) => x.length + y + + val y: String => Boolean = x + + val yy: (String, Int) => Any = xx + + val b = x("hello") + + val b1: Boolean = b + + val bi = x + + val bi1: Boolean = bi + + val c = xx("hh", 22) + + val c1: Int = c + } +} |