diff options
Diffstat (limited to 'src/dotty/tools/dotc/typer/ErrorReporting.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/ErrorReporting.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/typer/ErrorReporting.scala b/src/dotty/tools/dotc/typer/ErrorReporting.scala index 8d69239f2..119778139 100644 --- a/src/dotty/tools/dotc/typer/ErrorReporting.scala +++ b/src/dotty/tools/dotc/typer/ErrorReporting.scala @@ -32,7 +32,7 @@ object ErrorReporting { val treeSym = ctx.symOfContextTree(tree) if (treeSym.exists && treeSym.name == cycleSym.name && treeSym.owner == cycleSym.owner) { val result = if (cycleSym.isSourceMethod) " result" else "" - i"overloaded or recursive $cycleSym needs$result type" + d"overloaded or recursive $cycleSym needs$result type" } else errorMsg(msg, cx.outer) case _ => @@ -48,11 +48,11 @@ object ErrorReporting { case tp: FunProto => val result = tp.resultType match { case tp: WildcardType => "" - case tp => i"and expected result type $tp" + case tp => d"and expected result type $tp" } - i"arguments (${tp.typedArgs.tpes}%, %)$result" + d"arguments (${tp.typedArgs.tpes}%, %)$result" case _ => - i"expected type $tp" + d"expected type $tp" } def anonymousTypeMemberStr(tpe: Type) = { @@ -61,12 +61,12 @@ object ErrorReporting { case _: PolyType | _: MethodType => "method" case _ => "value of type" } - i"$kind $tpe" + d"$kind $tpe" } def overloadedAltsStr(alts: List[SingleDenotation]) = - i"overloaded alternatives of ${denotStr(alts.head)} with types\n" + - i" ${alts map (_.info)}%\n %" + d"overloaded alternatives of ${denotStr(alts.head)} with types\n" + + d" ${alts map (_.info)}%\n %" def denotStr(denot: Denotation): String = if (denot.isOverloaded) overloadedAltsStr(denot.alternatives) @@ -96,7 +96,7 @@ object ErrorReporting { case tp: TypeRef => s"with info ${tp.info} / ${tp.prefix.toString} / ${tp.prefix.dealias.toString}" case _ => "" } - i"""type mismatch: + d"""type mismatch: | found : $found | required: $expected""".stripMargin + typerStateStr + explanationStr } @@ -122,7 +122,7 @@ object ErrorReporting { case _ => true } - val s = new InfoString(sc).i(args) + val s = new InfoString(sc).i(args : _*) if (args.forall(isSensical(_))) s else nonSensicalStartTag + s + nonSensicalEndTag } } |