Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
wisdomseeker2001 committed Dec 12, 2022
1 parent 085e76f commit 47ce580
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,8 @@ trait Applications extends Compatibility {
harmonizeSeq(la :+ x1, elemFormal)
makeSeqLiteral(la.length + 1, elemFormal)
concatVararg(xs, Nil, counter + 1)
else if (isVarArg(x1)) then /
val seqElemFormal = defn.SeqType.appliedTo(elemFormal)
else if (isVarArg(x1)) then
val seqElemFormal = defn.SeqType.appliedTo(elemFormal)
addArg(typedArg(x1, seqElemFormal), seqElemFormal)
concatVararg(xs, Nil, counter + 1)
case Nil =>
Expand Down Expand Up @@ -828,18 +828,14 @@ trait Applications extends Compatibility {
else t

val varArgTrees = typedArgBuf.takeRight(n)
println(s"type = ${varArgTrees.getClass}")
typedArgBuf.dropRightInPlace(n)
val repeatedarg = seqToRepeated(
varArgTrees.reduce{
(lh, rh) => removeRepeated(lh).select(defn.Seq_++).appliedToType(elemFormal).appliedTo(removeRepeated(rh))})
val repeatedarg =
seqToRepeated(varArgTrees.reduce{
(lh, rh) => removeRepeated(lh).select(defn.Seq_++).
appliedToType(elemFormal).appliedTo(removeRepeated(rh))})
typedArgBuf += repeatedarg




// x1.asInstanceOf[Typed].expr

def harmonizeArgs(args: List[TypedArg]): List[Tree] =
// harmonize args only if resType depends on parameter types
if (isFullyDefined(methodType.resType, ForceDegree.none)) args
Expand Down

0 comments on commit 47ce580

Please sign in to comment.