@@ -855,7 +855,7 @@ object Semantic:
855
855
// init "fake" param fields for parameters of primary and secondary constructors
856
856
def addParamsAsFields (args : List [Value ], ref : Ref , ctorDef : DefDef ) =
857
857
val params = ctorDef.termParamss.flatten.map(_.symbol)
858
- assert(args.size == params.size, " arguments = " + args.size + " , params = " + params.size)
858
+ assert(args.size == params.size, " arguments = " + args.size + " , params = " + params.size + " , ctor = " + ctor.show )
859
859
for (param, value) <- params.zip(args) do
860
860
ref.updateField(param, value)
861
861
printer.println(param.show + " initialized with " + value)
@@ -1663,9 +1663,14 @@ object Semantic:
1663
1663
// term arguments to B. That can only be done in a concrete class.
1664
1664
val tref = typeRefOf(klass.typeRef.baseType(mixin).typeConstructor)
1665
1665
val ctor = tref.classSymbol.primaryConstructor
1666
- if ctor.exists then extendTrace(superParent) {
1667
- superCall(tref, ctor, Nil , tasks)
1668
- }
1666
+ if ctor.exists then
1667
+ // The parameter check of traits comes late in the mixin phase.
1668
+ // To avoid crash we supply hot values for erroneous parent calls.
1669
+ // See tests/neg/i16438.scala.
1670
+ val args : List [ArgInfo ] = ctor.info.paramInfoss.flatten.map(_ => ArgInfo (Hot , Trace .empty))
1671
+ extendTrace(superParent) {
1672
+ superCall(tref, ctor, args, tasks)
1673
+ }
1669
1674
}
1670
1675
1671
1676
// initialize super classes after outers are set
0 commit comments