Skip to content

Commit 9b67ac2

Browse files
replace some s"..." by i"..."
Conflicts: src/dotty/tools/dotc/typer/TypeAssigner.scala
1 parent 77a04b2 commit 9b67ac2

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,9 @@ trait Applications extends Compatibility { self: Typer =>
588588
def extractorMemberType(tp: Type, name: Name) = {
589589
val ref = tp member name
590590
if (ref.isOverloaded)
591-
errorType(s"Overloaded reference to ${ref.show} is not allowed in extractor", tree.pos)
591+
errorType(i"Overloaded reference to $ref is not allowed in extractor", tree.pos)
592592
else if (ref.info.isInstanceOf[PolyType])
593-
errorType(s"Reference to polymorphic ${ref.show}: ${ref.info.show} is not allowed in extractor", tree.pos)
593+
errorType(i"Reference to polymorphic $ref: ${ref.info} is not allowed in extractor", tree.pos)
594594
else
595595
ref.info.widenExpr.dealias
596596
}
@@ -618,7 +618,7 @@ trait Applications extends Compatibility { self: Typer =>
618618
if (unapplyResult derivesFrom defn.SeqClass) seqSelector :: Nil
619619
else if (unapplyResult isRef defn.BooleanClass) Nil
620620
else {
621-
ctx.error(s"${unapplyResult.show} is not a valid result type of an unapply method of an extractor", tree.pos)
621+
ctx.error(i"$unapplyResult is not a valid result type of an unapply method of an extractor", tree.pos)
622622
Nil
623623
}
624624
}
@@ -636,7 +636,7 @@ trait Applications extends Compatibility { self: Typer =>
636636
unapplyFn.tpe.widen match {
637637
case mt: MethodType if mt.paramTypes.length == 1 && !mt.isDependent =>
638638
val unapplyArgType = mt.paramTypes.head
639-
unapp.println(s"unapp arg tpe = ${unapplyArgType.show}, pt = ${pt.show}")
639+
unapp.println(i"unapp arg tpe = $unapplyArgType, pt = $pt")
640640
def wpt = widenForMatchSelector(pt) // needed?
641641
val ownType =
642642
if (pt <:< unapplyArgType) {

src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ trait TypeAssigner {
204204
case Nil =>
205205
errorType(d"$mix does not name a parent class of $cls", tree.pos)
206206
case p :: q :: _ =>
207-
errorType(s"ambiguous parent class qualifier", tree.pos)
207+
errorType("ambiguous parent class qualifier", tree.pos)
208208
}
209209
val owntype =
210210
if (!mix.isEmpty) findMixinSuper(cls.info)
@@ -217,9 +217,9 @@ trait TypeAssigner {
217217
val ownType = fn.tpe.widen match {
218218
case fntpe @ MethodType(_, ptypes) =>
219219
if (sameLength(ptypes, args)) fntpe.instantiate(args.tpes)
220-
else errorType(s"wrong number of parameters for ${fn.tpe}; expected: ${ptypes.length}", tree.pos)
220+
else errorType(i"wrong number of parameters for ${fn.tpe}; expected: ${ptypes.length}", tree.pos)
221221
case t =>
222-
errorType(s"${err.exprStr(fn)} does not take parameters", tree.pos)
222+
errorType(i"${err.exprStr(fn)} does not take parameters", tree.pos)
223223
}
224224
tree.withType(ownType)
225225
}
@@ -231,7 +231,7 @@ trait TypeAssigner {
231231
if (sameLength(argTypes, pt.paramNames)) pt.instantiate(argTypes)
232232
else errorType(d"wrong number of type parameters for ${fn.tpe}; expected: ${pt.paramNames.length}", tree.pos)
233233
case _ =>
234-
errorType(s"${err.exprStr(fn)} does not take type parameters", tree.pos)
234+
errorType(i"${err.exprStr(fn)} does not take type parameters", tree.pos)
235235
}
236236
tree.withType(ownType)
237237
}

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,15 +490,15 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
490490
}
491491
val ofFun =
492492
if (nme.syntheticParamNames(args.length + 1) contains param.name)
493-
s" of expanded function ${tree.show}"
493+
i" of expanded function $tree"
494494
else
495495
""
496-
errorType(s"missing parameter type for parameter ${param.name}$ofFun, expected = ${pt.show}", param.pos)
496+
errorType(i"missing parameter type for parameter ${param.name}$ofFun, expected = $pt", param.pos)
497497
}
498498

499499
def protoFormal(i: Int): Type =
500500
if (protoFormals.length == params.length) protoFormals(i)
501-
else errorType(s"wrong number of parameters, expected: ${protoFormals.length}", tree.pos)
501+
else errorType(i"wrong number of parameters, expected: ${protoFormals.length}", tree.pos)
502502

503503
val inferredParams: List[untpd.ValDef] =
504504
for ((param, i) <- params.zipWithIndex) yield
@@ -700,7 +700,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
700700
}
701701
val res = cpy.RefinedTypeTree(tree, tpt1, refinements1) withType
702702
(tpt1.tpe /: refinements1)(addRefinement)
703-
typr.println(s"typed refinement: ${res.tpe.show}")
703+
typr.println(i"typed refinement: ${res.tpe}")
704704
res
705705
}
706706

@@ -728,7 +728,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
728728

729729
def typedBind(tree: untpd.Bind, pt: Type)(implicit ctx: Context): Bind = track("typedBind") {
730730
val body1 = typed(tree.body, pt)
731-
typr.println(s"typed bind ${tree.show} pt = ${pt.show} bodytpe = ${body1.tpe.show}")
731+
typr.println(i"typed bind $tree pt = $pt bodytpe = ${body1.tpe}")
732732
val sym = ctx.newSymbol(ctx.owner, tree.name.asTermName, EmptyFlags, body1.tpe, coord = tree.pos)
733733
assignType(cpy.Bind(tree, tree.name, body1), sym)
734734
}
@@ -951,7 +951,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
951951
}
952952
}
953953

954-
def typed(tree: untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): Tree = /*>|>*/ ctx.traceIndented (s"typing ${tree.show}", typr, show = true) /*<|<*/ {
954+
def typed(tree: untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): Tree = /*>|>*/ ctx.traceIndented (i"typing $tree", typr, show = true) /*<|<*/ {
955955
if (!tree.isEmpty && ctx.typerState.isGlobalCommittable) assert(tree.pos.exists, tree)
956956
try adapt(typedUnadapted(tree, pt), pt)
957957
catch {
@@ -1158,7 +1158,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
11581158
if (tree.tpe <:< pt) tree
11591159
else if (ctx.mode is Mode.Pattern) tree // no subtype check for pattern
11601160
else {
1161-
typr.println(s"adapt to subtype ${tree.tpe.show} !<:< ${pt.show}")
1161+
typr.println(i"adapt to subtype ${tree.tpe} !<:< $pt")
11621162
//typr.println(TypeComparer.explained(implicit ctx => tree.tpe <:< pt))
11631163
adaptToSubType(wtp)
11641164
}

0 commit comments

Comments
 (0)