diff options
author | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-03-26 20:53:17 +0100 |
---|---|---|
committer | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-04-02 15:05:19 +0200 |
commit | 77a04b26d7c24ed56b4be45cfb41fa8b2e75a461 (patch) | |
tree | 618b6a85fe0546bd27ec78b10560145edd8191eb /src/dotty/tools/dotc/typer/ErrorReporting.scala | |
parent | e4ee662a55c83568caa18a8d2212766f299cc575 (diff) | |
download | dotty-77a04b26d7c24ed56b4be45cfb41fa8b2e75a461.tar.gz dotty-77a04b26d7c24ed56b4be45cfb41fa8b2e75a461.tar.bz2 dotty-77a04b26d7c24ed56b4be45cfb41fa8b2e75a461.zip |
replace i"..." by d"..." if string might go into a
Diagnostic and might be nonsensical
Conflicts:
src/dotty/tools/dotc/typer/Checking.scala
src/dotty/tools/dotc/typer/TypeAssigner.scala
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 } } |