File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
116116 * This info is used in phase ParamForwarding
117117 */
118118 private def forwardParamAccessors (impl : Template )(using Context ): Unit = impl.parents match
119- case superCall @ Apply (fn, superArgs) :: _ if superArgs.nonEmpty =>
119+ case superCall @ Apply (fn, superArgs) :: _
120+ if superArgs.nonEmpty && fn.symbol.isPrimaryConstructor =>
120121 fn.tpe.widen match
121122 case MethodType (superParamNames) =>
122123 for case stat : ValDef <- impl.body do
Original file line number Diff line number Diff line change 1+ class Foo (val s : Any ):
2+ def this (s : String ) =
3+ this (0 )
4+ class Bar (s : String ) extends Foo (s):
5+ def foo = s
6+
7+ class Foo2 (val s : Any )
8+ class Bar2 (s : String ) extends Foo2 (s):
9+ def foo = s
10+
11+ case class Config (_config : String )
12+
13+ abstract class Foo3 (val config : Config ) {
14+ def this (config : String ) = {
15+ this (Config (config))
16+ }
17+ }
18+
19+ class Bar3 (config : String ) extends Foo3 (config) {
20+ def foo (): Unit = {
21+ config.getClass()
22+ }
23+ }
24+
25+
26+ @ main def Test =
27+ Bar (" " ).foo
28+ Bar2 (" " ).foo
29+ Bar3 (" " ).foo()
You can’t perform that action at this time.
0 commit comments