Skip to content

Commit 67f11ff

Browse files
authored
Merge pull request #15695 from dotty-staging/zero-init-warnings
Add two tests
2 parents 776bb11 + f7986c1 commit 67f11ff

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Outer:
2+
trait A:
3+
def foo() = println(m)
4+
5+
trait B extends A
6+
7+
class C extends B
8+
9+
def bar(c: C) = c.foo()
10+
11+
bar(new C) // error
12+
val m = 10
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
trait A(o: Outer):
2+
def foo() = println(o.m)
3+
4+
class Outer:
5+
trait B extends A
6+
7+
class C extends B with A(this)
8+
9+
def bar(c: C) = c.foo()
10+
11+
bar(new C) // error
12+
val m = 10

0 commit comments

Comments
 (0)