Skip to content

Commit 35717b7

Browse files
committed
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)
1 parent 6571efa commit 35717b7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/dotty/tools/dotc/core/Decorators.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Contexts._, Names._, Phases._, printing.Texts._, printing.Printer, printi
77
import util.Positions.Position, util.SourcePosition
88
import collection.mutable.ListBuffer
99
import dotty.tools.dotc.transform.TreeTransforms._
10+
import typer.Mode
1011
import scala.language.implicitConversions
1112

1213
/** This object provides useful implicit decorators for types defined elsewhere */
@@ -172,7 +173,7 @@ object Decorators {
172173
def treatSingleArg(arg: Any) : Any =
173174
try
174175
arg match {
175-
case arg: Showable => arg.show
176+
case arg: Showable => arg.show(ctx.fresh.addMode(Mode.FutureDefsOK))
176177
case _ => arg
177178
}
178179
catch {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ import Types._, Symbols._, Flags._, StdNames._
99
import util.Positions._
1010
import ast.Trees._
1111
import typer.ErrorReporting._
12+
import DenotTransformers._
1213

1314
/** This checks `New` nodes, verifying that they can be instantiated. */
14-
class InstChecks extends Phase {
15+
class InstChecks extends Phase with IdentityDenotTransformer {
1516
import ast.tpd._
1617

1718
override def phaseName: String = "instchecks"

0 commit comments

Comments
 (0)