diff options
author | Sébastien Doeraene <sjrdoeraene@gmail.com> | 2016-03-05 09:51:50 +0100 |
---|---|---|
committer | Sébastien Doeraene <sjrdoeraene@gmail.com> | 2016-03-07 16:18:54 +0100 |
commit | 4b10e2b7127f3644453a00fe54fec0212614c944 (patch) | |
tree | ddc25411d2734004e144d55c9d51231f59d0b795 /tests/run/non-jvm-sam-non-apply.scala | |
parent | a50926701ef5171779aa025d2d307751d166cabe (diff) | |
download | dotty-4b10e2b7127f3644453a00fe54fec0212614c944.tar.gz dotty-4b10e2b7127f3644453a00fe54fec0212614c944.tar.bz2 dotty-4b10e2b7127f3644453a00fe54fec0212614c944.zip |
Fix #1146: Fix bug of ExpandSAMs with non-apply SAM methods.
When expanding a SAM, ExpandSAMs always used the name `apply` for
the generated forwarder, instead of the name of the method which
is abstract in the SAM type. This commit fixes this issue.
Diffstat (limited to 'tests/run/non-jvm-sam-non-apply.scala')
-rw-r--r-- | tests/run/non-jvm-sam-non-apply.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/run/non-jvm-sam-non-apply.scala b/tests/run/non-jvm-sam-non-apply.scala new file mode 100644 index 000000000..e3bfac928 --- /dev/null +++ b/tests/run/non-jvm-sam-non-apply.scala @@ -0,0 +1,11 @@ +// shouldn't result in an abstract method error when run +abstract class NonJVMSam { + def foo(x: Int): Int +} + +object Test { + def main(args: Array[String]): Unit = { + val f: NonJVMSam = x => x + 1 + println(f.foo(3)) + } +} |