From 1e39a10830e8c37ce663e1f82a5d16d7b18eb50b Mon Sep 17 00:00:00 2001 From: Liu Fengyun Date: Wed, 24 Mar 2021 10:41:44 +0100 Subject: [PATCH] Add forgotten test for function specialization --- tests/run/multi-apply.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/run/multi-apply.scala diff --git a/tests/run/multi-apply.scala b/tests/run/multi-apply.scala new file mode 100644 index 000000000000..5b7fd24ddb27 --- /dev/null +++ b/tests/run/multi-apply.scala @@ -0,0 +1,11 @@ +class MultiApply extends (Int => Int) with ((Int, Int) => Int) { + def apply(x: Int): Int = x + x + def apply(x: Int, y: Int): Int = x * y +} + +@main +def Test = { + val fun = new MultiApply + assert(fun(2) == 4) + assert(fun(2, 3) == 6) +} \ No newline at end of file