diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-10 11:06:49 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-03-10 15:09:26 +0100 |
commit | ba8d9ea2e4b887fc0faa1f636aade84c45292144 (patch) | |
tree | 32df76e7d56184974e3f615131288601a8a97181 /src | |
parent | ac45e122b76a454a06026f280197af0f72140903 (diff) | |
download | dotty-ba8d9ea2e4b887fc0faa1f636aade84c45292144.tar.gz dotty-ba8d9ea2e4b887fc0faa1f636aade84c45292144.tar.bz2 dotty-ba8d9ea2e4b887fc0faa1f636aade84c45292144.zip |
Fix for t1002
Need to compile the self type of a class not in the context of the class members but one context further out.
Reason: self type should not be able to see the members.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 51eba3b02..6a1d279df 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -786,7 +786,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit val constr1 = typed(constr).asInstanceOf[DefDef] val parents1 = ensureConstrCall(ensureFirstIsClass( parents mapconserve typedParent, cdef.pos.toSynthetic)) - val self1 = typed(self).asInstanceOf[ValDef] + val self1 = typed(self)(ctx.outer).asInstanceOf[ValDef] // outer context where class memebers are not visible val localDummy = ctx.newLocalDummy(cls, impl.pos) val body1 = typedStats(body, localDummy)(inClassContext(self1.symbol)) checkNoDoubleDefs(cls) |