Skip to content

Commit 06e577f

Browse files
committed
Add tests
1 parent afd304a commit 06e577f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

tests/init/neg/global-cycle10.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
abstract class Base {
2+
def foo(): Unit
3+
foo()
4+
}
5+
6+
object O extends Base { // error
7+
val msg: String = "hello"
8+
9+
class Inner {
10+
println(msg)
11+
}
12+
13+
def foo() = new Inner
14+
}
15+
16+
@main
17+
def Test = O

tests/init/neg/global-cycle8.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class A {
2+
def foo() = println(O.n)
3+
}
4+
5+
class B {
6+
val a = new A
7+
}
8+
9+
object O { // error
10+
val n: Int = 10
11+
println(P.m)
12+
}
13+
14+
object P {
15+
val m = Q.bar(new B)
16+
}
17+
18+
object Q {
19+
def bar(b: B) = b.a.foo()
20+
}
21+

0 commit comments

Comments
 (0)