aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-09-04 08:35:42 +0200
committerMartin Odersky <odersky@gmail.com>2014-09-04 08:41:01 +0200
commit225102627d37f16134bc682eb5b01270684a02e4 (patch)
tree6a57d22adc7c8231b7fbfcc22832ab68a698cb95 /src/dotty/tools/dotc/typer/Typer.scala
parent2558c49984611935fff91b0b062f6af5a61e71ce (diff)
downloaddotty-225102627d37f16134bc682eb5b01270684a02e4.tar.gz
dotty-225102627d37f16134bc682eb5b01270684a02e4.tar.bz2
dotty-225102627d37f16134bc682eb5b01270684a02e4.zip
Add inSuperCall mode and flag.
Needed to keep a record of definitions in supercall arguments. These may not see the enclosing class.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index f58ccbdbc..9c5fb09b0 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -951,8 +951,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
val typer1 = localTyper(sym)
typer1.typedDefDef(tree, sym)(localContext(tree, sym).setTyper(typer1))
case tree: untpd.TypeDef =>
- if (tree.isClassDef) typedClassDef(tree, sym.asClass)(localContext(tree, sym))
- else typedTypeDef(tree, sym)(localContext(tree, sym).setNewScope)
+ if (tree.isClassDef)
+ typedClassDef(tree, sym.asClass)(localContext(tree, sym).setMode(ctx.mode &~ Mode.InSuperCall))
+ else
+ typedTypeDef(tree, sym)(localContext(tree, sym).setNewScope)
case _ => typedUnadapted(desugar(tree), pt)
}
}