diff options
author | Martin Odersky <odersky@gmail.com> | 2014-05-01 19:26:04 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-05-08 21:51:47 +0200 |
commit | 9a251994b59bdcfc3acfb4d8b22aaee359724e6b (patch) | |
tree | 4f83a6fbe277526ebcd5da8c69dd994d92666f0b /src | |
parent | 69403ee21743246c3f1d10cfa5f5b0c76d01e0c7 (diff) | |
download | dotty-9a251994b59bdcfc3acfb4d8b22aaee359724e6b.tar.gz dotty-9a251994b59bdcfc3acfb4d8b22aaee359724e6b.tar.bz2 dotty-9a251994b59bdcfc3acfb4d8b22aaee359724e6b.zip |
Adding descriptive message to no-implicits-after-typer assertion.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/transform/TreeChecker.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Implicits.scala | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/transform/TreeChecker.scala b/src/dotty/tools/dotc/transform/TreeChecker.scala index 42e4f95ba..e9970e1f8 100644 --- a/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -8,7 +8,7 @@ import core.SymDenotations._ import core.Contexts._ import core.Symbols._ import core.Types._ -import core.Flags.Method +import core.Flags._ import core.Constants._ import core.StdNames._ import core.Decorators._ diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala index d4cfc1b8e..a32f552ed 100644 --- a/src/dotty/tools/dotc/typer/Implicits.scala +++ b/src/dotty/tools/dotc/typer/Implicits.scala @@ -400,7 +400,9 @@ trait Implicits { self: Typer => * !!! todo: catch potential cycles */ def inferImplicit(pt: Type, argument: Tree, pos: Position)(implicit ctx: Context): SearchResult = track("inferImplicit") { - assert(!ctx.isAfterTyper) + assert(!ctx.isAfterTyper, + if (argument.isEmpty) i"missing implicit parameter of type $pt after typer" + else i"type error: ${argument.tpe} does not conform to $pt") ctx.traceIndented(s"search implicit ${pt.show}, arg = ${argument.show}: ${argument.tpe.show}", implicits, show = true) { assert(!pt.isInstanceOf[ExprType]) val isearch = |