diff options
author | Martin Odersky <odersky@gmail.com> | 2015-04-13 16:43:49 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-04-13 17:28:24 +0200 |
commit | 35717b7d3029a87a4ec7c9b45d18644b33b560e8 (patch) | |
tree | 73c67082c47f7e7d9cd68d6b12bc23598c21e805 /src | |
parent | 6571efa7ea1a5bd973ff010de6e38901cc77387b (diff) | |
download | dotty-35717b7d3029a87a4ec7c9b45d18644b33b560e8.tar.gz dotty-35717b7d3029a87a4ec7c9b45d18644b33b560e8.tar.bz2 dotty-35717b7d3029a87a4ec7c9b45d18644b33b560e8.zip |
Allow future defs when printing with i"...".
We saw a failure of accessing a denotation outside its defined interval, which got triggered
by i"...". This should never be the case. We should be more interested in what i"..." has to print.
(V2, to see whether this builds with Travis now)
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Decorators.scala | 3 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/InstChecks.scala | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Decorators.scala b/src/dotty/tools/dotc/core/Decorators.scala index 1ce834428..4e672ef40 100644 --- a/src/dotty/tools/dotc/core/Decorators.scala +++ b/src/dotty/tools/dotc/core/Decorators.scala @@ -7,6 +7,7 @@ import Contexts._, Names._, Phases._, printing.Texts._, printing.Printer, printi import util.Positions.Position, util.SourcePosition import collection.mutable.ListBuffer import dotty.tools.dotc.transform.TreeTransforms._ +import typer.Mode import scala.language.implicitConversions /** This object provides useful implicit decorators for types defined elsewhere */ @@ -172,7 +173,7 @@ object Decorators { def treatSingleArg(arg: Any) : Any = try arg match { - case arg: Showable => arg.show + case arg: Showable => arg.show(ctx.fresh.addMode(Mode.FutureDefsOK)) case _ => arg } catch { diff --git a/src/dotty/tools/dotc/typer/InstChecks.scala b/src/dotty/tools/dotc/typer/InstChecks.scala index 91c109ce8..7148a6e68 100644 --- a/src/dotty/tools/dotc/typer/InstChecks.scala +++ b/src/dotty/tools/dotc/typer/InstChecks.scala @@ -9,9 +9,10 @@ import Types._, Symbols._, Flags._, StdNames._ import util.Positions._ import ast.Trees._ import typer.ErrorReporting._ +import DenotTransformers._ /** This checks `New` nodes, verifying that they can be instantiated. */ -class InstChecks extends Phase { +class InstChecks extends Phase with IdentityDenotTransformer { import ast.tpd._ override def phaseName: String = "instchecks" |