Skip to content

Commit 9a25199

Browse files
oderskyDarkDimius
authored andcommitted
Adding descriptive message to no-implicits-after-typer assertion.
1 parent 69403ee commit 9a25199

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import core.SymDenotations._
88
import core.Contexts._
99
import core.Symbols._
1010
import core.Types._
11-
import core.Flags.Method
11+
import core.Flags._
1212
import core.Constants._
1313
import core.StdNames._
1414
import core.Decorators._

src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ trait Implicits { self: Typer =>
400400
* !!! todo: catch potential cycles
401401
*/
402402
def inferImplicit(pt: Type, argument: Tree, pos: Position)(implicit ctx: Context): SearchResult = track("inferImplicit") {
403-
assert(!ctx.isAfterTyper)
403+
assert(!ctx.isAfterTyper,
404+
if (argument.isEmpty) i"missing implicit parameter of type $pt after typer"
405+
else i"type error: ${argument.tpe} does not conform to $pt")
404406
ctx.traceIndented(s"search implicit ${pt.show}, arg = ${argument.show}: ${argument.tpe.show}", implicits, show = true) {
405407
assert(!pt.isInstanceOf[ExprType])
406408
val isearch =

0 commit comments

Comments
 (0)