diff options
author | Martin Odersky <odersky@gmail.com> | 2014-04-19 19:48:57 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-05-08 21:48:08 +0200 |
commit | d78885ff06bea4840cdf9bee61dd3698fcff820a (patch) | |
tree | c93a65fdd1219d2dbe26a59de4873c79b808d471 /src/dotty/tools/dotc/typer/Implicits.scala | |
parent | 9203e01ddd141ddbb96e3064be5e894ddb666fd8 (diff) | |
download | dotty-d78885ff06bea4840cdf9bee61dd3698fcff820a.tar.gz dotty-d78885ff06bea4840cdf9bee61dd3698fcff820a.tar.bz2 dotty-d78885ff06bea4840cdf9bee61dd3698fcff820a.zip |
isAfterTyper test
Add test whether we are after typer. Use it to assert that
eta expansion and implicit search do not happen after typer.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Implicits.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Implicits.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala index 93876651a..4767e6dd3 100644 --- a/src/dotty/tools/dotc/typer/Implicits.scala +++ b/src/dotty/tools/dotc/typer/Implicits.scala @@ -400,6 +400,7 @@ 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) ctx.traceIndented(s"search implicit ${pt.show}, arg = ${argument.show}: ${argument.tpe.show}", implicits, show = true) { assert(!pt.isInstanceOf[ExprType]) val isearch = @@ -472,7 +473,7 @@ trait Implicits { self: Typer => shadowedImplicit(ref, methPart(shadowing).tpe) } else - SearchSuccess(generated, ref, ctx.typerState) + SearchSuccess(generated1, ref, ctx.typerState) }} /** Given a list of implicit references, produce a list of all implicit search successes, |