diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-10-13 02:05:30 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-10-13 02:08:12 +0200 |
commit | 6e78c7aff351de5e5c8ccddc319744a4f976d79c (patch) | |
tree | 734fe4470856c936a392b66dedcf8d6dba6eac58 /tests/run/unit_erasure.scala | |
parent | 1c62d0557417612fb90108fd6a3728d7c510f968 (diff) | |
download | dotty-6e78c7aff351de5e5c8ccddc319744a4f976d79c.tar.gz dotty-6e78c7aff351de5e5c8ccddc319744a4f976d79c.tar.bz2 dotty-6e78c7aff351de5e5c8ccddc319744a4f976d79c.zip |
Fix erasure of "def foo[T]: Unit", do not box the return type
Diffstat (limited to 'tests/run/unit_erasure.scala')
-rw-r--r-- | tests/run/unit_erasure.scala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/run/unit_erasure.scala b/tests/run/unit_erasure.scala new file mode 100644 index 000000000..51ccf0a16 --- /dev/null +++ b/tests/run/unit_erasure.scala @@ -0,0 +1,16 @@ +class A { + def foo1[T]: Unit = {} + def foo2[T](): Unit = {} + def foo3[T]()(): Unit = {} + def foo4: Unit = {} + def foo5(): Unit = {} + def foo6()(): Unit = {} +} + +object Test { + def main(args: Array[String]): Unit = { + classOf[A].getMethods.toList.filter(_.getName.startsWith("foo")).foreach { m => + assert(m.getGenericReturnType == Void.TYPE, s"Method does not return void: `${m}`") + } + } +}
\ No newline at end of file |