diff --git a/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala b/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala index 219e51050961..084b0793607d 100644 --- a/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala +++ b/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala @@ -67,7 +67,7 @@ class HoistSuperArgs extends MiniPhase with IdentityDenotTransformer { thisPhase val constr = cdef.symbol lazy val origParams = // The parameters that can be accessed in the supercall if (constr == cls.primaryConstructor) - cls.info.decls.filter(d => d.is(TypeParam) || d.is(ParamAccessor)) + cls.info.decls.filter(d => d.is(TypeParam) || d.is(ParamAccessor) && !d.isSetter) else allParamSyms(cdef) diff --git a/tests/pos/i11045.scala b/tests/pos/i11045.scala new file mode 100644 index 000000000000..da5d66a7a633 --- /dev/null +++ b/tests/pos/i11045.scala @@ -0,0 +1,2 @@ +abstract class Foo(x: Any) +class Boom(var x: Unit, y: Unit) extends Foo((x: Int) => x) \ No newline at end of file