File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -896,7 +896,7 @@ class Semantic {
896
896
897
897
def default () = Result (Hot , Nil )
898
898
899
- if sym.is(Flags .Param ) && sym.owner.isConstructor then
899
+ if sym.is(Flags .Param ) && sym.owner.isConstructor && sym.isContainedIn(klass) then
900
900
// instances of local classes inside secondary constructors cannot
901
901
// reach here, as those values are abstracted by Cold instead of Warm.
902
902
// This enables us to simplify the domain without sacrificing
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class M(x: Int) {
35
35
val n : Int = 10
36
36
}
37
37
38
- new A (new B (new D ))
38
+ new A (new B (new D )) // error
39
39
40
40
trait T {
41
41
val m : Int = 10
@@ -51,3 +51,7 @@ class M(x: Int) {
51
51
}
52
52
}
53
53
}
54
+
55
+ class N extends M (" hello" ) {
56
+ val msg = " Scala"
57
+ }
You can’t perform that action at this time.
0 commit comments