diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-07-17 11:48:49 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-07-17 15:54:57 +0200 |
commit | 43da1dbbe99e8bdb98d9e08b8e3a255dd4af6902 (patch) | |
tree | ae212e62df5c89e3c86fc8c86868e2352dc0d11f /src/compiler | |
parent | c6bee6437a626c93be3951ee0437adce8c88e96c (diff) | |
download | scala-43da1dbbe99e8bdb98d9e08b8e3a255dd4af6902.tar.gz scala-43da1dbbe99e8bdb98d9e08b8e3a255dd4af6902.tar.bz2 scala-43da1dbbe99e8bdb98d9e08b8e3a255dd4af6902.zip |
Introduce `AbsAmbiguousTypeError`.
It's the superclass for type errors that should be issued
with `issueAmbiguousError`.
TODO: enforce this in `issues` itself using a type test,
remove the static overload.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index 99cd027df0..20e462bbce 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -27,6 +27,16 @@ trait ContextErrors { override def toString() = "[Type error at:" + errPos + "] " + errMsg } + abstract class AbsAmbiguousTypeError extends AbsTypeError + + case class AmbiguousTypeError(errPos: Position, errMsg: String) + extends AbsAmbiguousTypeError + + case class AmbiguousImplicitTypeError(underlyingTree: Tree, errMsg: String) + extends AbsAmbiguousTypeError { + def errPos = underlyingTree.pos + } + sealed abstract class TreeTypeError extends AbsTypeError { def underlyingTree: Tree def errPos = underlyingTree.pos @@ -38,9 +48,6 @@ trait ContextErrors { case class AccessTypeError(underlyingTree: Tree, errMsg: String) extends TreeTypeError - case class AmbiguousTypeError(errPos: Position, errMsg: String) - extends AbsTypeError - case class SymbolTypeError(underlyingSym: Symbol, errMsg: String) extends AbsTypeError { @@ -75,8 +82,6 @@ trait ContextErrors { s"diverging implicit expansion for type ${pt}\nstarting with ${sym.fullLocationString}" } - case class AmbiguousImplicitTypeError(underlyingTree: Tree, errMsg: String) - extends TreeTypeError case class PosAndMsgTypeError(errPos: Position, errMsg: String) extends AbsTypeError |