aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-08 16:51:06 +0100
committerMartin Odersky <odersky@gmail.com>2017-03-08 16:52:43 +0100
commit22e9219dd46eeb3b4ba3823d6dc45bc42c41dca1 (patch)
tree7a6f87b1e615c218258666004cca2766895640a4 /compiler/src/dotty/tools/dotc/typer/Typer.scala
parentc84480960cf618c29705dbaab9332d304a081524 (diff)
downloaddotty-22e9219dd46eeb3b4ba3823d6dc45bc42c41dca1.tar.gz
dotty-22e9219dd46eeb3b4ba3823d6dc45bc42c41dca1.tar.bz2
dotty-22e9219dd46eeb3b4ba3823d6dc45bc42c41dca1.zip
Fix #2067: Compute defKind at Typer, not Namer
It's hard to predict for defKind all the desugarings that can be applied to a definition. Better to do it once the desugarings have been applied. NoInit and PureInterface are both tested only after Typer, so it's OK to delay their initialization until regular Typer.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Typer.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala
index b2e9d639d..ba14b7498 100644
--- a/compiler/src/dotty/tools/dotc/typer/Typer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -1314,6 +1314,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
val self1 = typed(self)(ctx.outer).asInstanceOf[ValDef] // outer context where class members are not visible
val dummy = localDummy(cls, impl)
val body1 = typedStats(impl.body, dummy)(inClassContext(self1.symbol))
+ cls.setNoInitsFlags((NoInitsInterface /: body1)((fs, stat) => fs & defKind(stat)))
// Expand comments and type usecases
cookComments(body1.map(_.symbol), self1.symbol)(localContext(cdef, cls).setNewScope)