This repository was archived by the owner on Jul 12, 2024. It is now read-only.
File tree 2 files changed +32
-0
lines changed
test-suite/src/main/scala/testsuite/core
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ object TestSuites {
7
7
TestSuite (" testsuite.core.add.Add" , " add" ),
8
8
TestSuite (" testsuite.core.add.Add" , " add" ),
9
9
TestSuite (" testsuite.core.virtualdispatch.VirtualDispatch" , " virtualDispatch" ),
10
+ TestSuite (" testsuite.core.interfacecall.InterfaceCall" , " interfaceCall" ),
10
11
TestSuite (" testsuite.core.asinstanceof.AsInstanceOfTest" , " asInstanceOf" ),
11
12
TestSuite (" testsuite.core.hijackedclassesmono.HijackedClassesMonoTest" , " hijackedClassesMono" )
12
13
)
Original file line number Diff line number Diff line change
1
+ package testsuite .core .interfacecall
2
+
3
+ import scala .scalajs .js .annotation ._
4
+
5
+ object InterfaceCall {
6
+ def main (): Unit = { val _ = test() }
7
+
8
+ @ JSExportTopLevel (" interfaceCall" )
9
+ def test (): Boolean = {
10
+ val c = new Concrete ()
11
+ c.plus(c.zero, 1 ) == 1 && c.minus(1 , c.zero) == 1
12
+ }
13
+
14
+ class Concrete extends AddSub with Zero {
15
+ override def zero : Int = 0
16
+ }
17
+
18
+ trait Adder {
19
+ def plus (a : Int , b : Int ) = a + b
20
+ }
21
+
22
+ trait Sub {
23
+ def minus (a : Int , b : Int ): Int = a - b
24
+ }
25
+
26
+ trait AddSub extends Adder with Sub
27
+
28
+ trait Zero {
29
+ def zero : Int
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments