Skip to content

Commit 25b0743

Browse files
authored
Merge pull request #11065 from dotty-staging/fix-#11045
Fix hoisting supercall arguments from primary constructor
2 parents 0f1d350 + 15b90b1 commit 25b0743

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class HoistSuperArgs extends MiniPhase with IdentityDenotTransformer { thisPhase
6767
val constr = cdef.symbol
6868
lazy val origParams = // The parameters that can be accessed in the supercall
6969
if (constr == cls.primaryConstructor)
70-
cls.info.decls.filter(d => d.is(TypeParam) || d.is(ParamAccessor))
70+
cls.info.decls.filter(d => d.is(TypeParam) || d.is(ParamAccessor) && !d.isSetter)
7171
else
7272
allParamSyms(cdef)
7373

tests/pos/i11045.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
abstract class Foo(x: Any)
2+
class Boom(var x: Unit, y: Unit) extends Foo((x: Int) => x)

0 commit comments

Comments
 (0)