Skip to content

Commit a460479

Browse files
authored
Merge pull request #11868 from dotty-staging/add-test
Add forgotten test for function specialization
2 parents 727a8bb + 1e39a10 commit a460479

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/run/multi-apply.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class MultiApply extends (Int => Int) with ((Int, Int) => Int) {
2+
def apply(x: Int): Int = x + x
3+
def apply(x: Int, y: Int): Int = x * y
4+
}
5+
6+
@main
7+
def Test = {
8+
val fun = new MultiApply
9+
assert(fun(2) == 4)
10+
assert(fun(2, 3) == 6)
11+
}

0 commit comments

Comments
 (0)