aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Applications.scala
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-09-21 10:09:13 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-10-10 13:25:35 +0200
commitaa559359bb55729913d34588462542f10c42e147 (patch)
treea42ca5b5e1b58dfa735c5239c04bd5e838d95d48 /src/dotty/tools/dotc/typer/Applications.scala
parent8743fa86e25133d0ddea3d85d7df0a5ceadef83a (diff)
downloaddotty-aa559359bb55729913d34588462542f10c42e147.tar.gz
dotty-aa559359bb55729913d34588462542f10c42e147.tar.bz2
dotty-aa559359bb55729913d34588462542f10c42e147.zip
Refactor explanation interpolator
Diffstat (limited to 'src/dotty/tools/dotc/typer/Applications.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 2c9039db1..56595a637 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -27,6 +27,7 @@ import collection.mutable
import config.Printers.{typr, unapp, overload}
import TypeApplications._
import language.implicitConversions
+import reporting.diagnostic.Message
object Applications {
import tpd._
@@ -132,10 +133,10 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
protected def harmonizeArgs(args: List[TypedArg]): List[TypedArg]
/** Signal failure with given message at position of given argument */
- protected def fail(msg: => String, arg: Arg): Unit
+ protected def fail(msg: => Message, arg: Arg): Unit
/** Signal failure with given message at position of the application itself */
- protected def fail(msg: => String): Unit
+ protected def fail(msg: => Message): Unit
protected def appPos: Position
@@ -186,7 +187,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
// it might be healed by an implicit conversion
assert(ctx.typerState.constraint eq savedConstraint)
else
- fail(err.typeMismatchStr(methType.resultType, resultType))
+ fail(err.typeMismatchMsg(methType.resultType, resultType))
}
// match all arguments with corresponding formal parameters
matchArgs(orderedArgs, methType.paramTypes, 0)
@@ -388,9 +389,9 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
def addArg(arg: TypedArg, formal: Type) =
ok = ok & isCompatible(argType(arg, formal), formal)
def makeVarArg(n: Int, elemFormal: Type) = {}
- def fail(msg: => String, arg: Arg) =
+ def fail(msg: => Message, arg: Arg) =
ok = false
- def fail(msg: => String) =
+ def fail(msg: => Message) =
ok = false
def appPos = NoPosition
lazy val normalizedFun = ref(methRef)
@@ -455,12 +456,12 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
override def appPos = app.pos
- def fail(msg: => String, arg: Trees.Tree[T]) = {
+ def fail(msg: => Message, arg: Trees.Tree[T]) = {
ctx.error(msg, arg.pos)
ok = false
}
- def fail(msg: => String) = {
+ def fail(msg: => Message) = {
ctx.error(msg, app.pos)
ok = false
}