aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Implicits.scala
diff options
context:
space:
mode:
authorSamuel Gruetter <samuel.gruetter@epfl.ch>2014-03-26 20:53:17 +0100
committerSamuel Gruetter <samuel.gruetter@epfl.ch>2014-04-02 15:05:19 +0200
commit77a04b26d7c24ed56b4be45cfb41fa8b2e75a461 (patch)
tree618b6a85fe0546bd27ec78b10560145edd8191eb /src/dotty/tools/dotc/typer/Implicits.scala
parente4ee662a55c83568caa18a8d2212766f299cc575 (diff)
downloaddotty-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/Implicits.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Implicits.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala
index db549b2d4..93876651a 100644
--- a/src/dotty/tools/dotc/typer/Implicits.scala
+++ b/src/dotty/tools/dotc/typer/Implicits.scala
@@ -204,8 +204,8 @@ object Implicits {
protected def pt: Type
protected def argument: tpd.Tree
protected def qualify(implicit ctx: Context) =
- if (argument.isEmpty) i"match type $pt"
- else i"convert from ${argument.tpe} to $pt"
+ if (argument.isEmpty) d"match type $pt"
+ else d"convert from ${argument.tpe} to $pt"
/** An explanation of the cause of the failure as a string */
def explanation(implicit ctx: Context): String
@@ -214,7 +214,7 @@ object Implicits {
/** An ambiguous implicits failure */
class AmbiguousImplicits(alt1: TermRef, alt2: TermRef, val pt: Type, val argument: tpd.Tree) extends ExplainedSearchFailure {
def explanation(implicit ctx: Context): String =
- i"both ${err.refStr(alt1)} and ${err.refStr(alt2)} $qualify"
+ d"both ${err.refStr(alt1)} and ${err.refStr(alt2)} $qualify"
override def postscript(implicit ctx: Context) =
"\nNote that implicit conversions cannot be applied because they are ambiguous;" +
"\n " + explanation
@@ -222,17 +222,17 @@ object Implicits {
class NonMatchingImplicit(ref: TermRef, val pt: Type, val argument: tpd.Tree) extends ExplainedSearchFailure {
def explanation(implicit ctx: Context): String =
- i"${err.refStr(ref)} does not $qualify"
+ d"${err.refStr(ref)} does not $qualify"
}
class ShadowedImplicit(ref: TermRef, shadowing: Type, val pt: Type, val argument: tpd.Tree) extends ExplainedSearchFailure {
def explanation(implicit ctx: Context): String =
- i"${err.refStr(ref)} does $qualify but is shadowed by ${err.refStr(shadowing)}"
+ d"${err.refStr(ref)} does $qualify but is shadowed by ${err.refStr(shadowing)}"
}
class DivergingImplicit(ref: TermRef, val pt: Type, val argument: tpd.Tree) extends ExplainedSearchFailure {
def explanation(implicit ctx: Context): String =
- i"${err.refStr(ref)} produces a diverging implicit search when trying to $qualify"
+ d"${err.refStr(ref)} produces a diverging implicit search when trying to $qualify"
}
class FailedImplicit(failures: List[ExplainedSearchFailure], val pt: Type, val argument: tpd.Tree) extends ExplainedSearchFailure {
@@ -425,7 +425,7 @@ trait Implicits { self: Typer =>
if (argument.isEmpty) f(resultType) else ViewProto(f(argument.tpe.widen), f(resultType))
assert(argument.isEmpty || argument.tpe.isValueType || argument.tpe.isInstanceOf[ExprType],
- i"found: ${argument.tpe}, expected: $pt")
+ d"found: ${argument.tpe}, expected: $pt")
/** The expected type for the searched implicit */
lazy val fullProto = implicitProto(pt, identity)