diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-02-05 11:53:43 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-02-05 20:05:55 +0100 |
commit | c9a0e36224b6eb2807bad0df2d5aa11bb05c8a32 (patch) | |
tree | 1d426346ba57ce6957403c232dacf1bf09635ff7 /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
parent | 570f4a46f663a8f55ce045bfde2d834bd4902f9c (diff) | |
download | scala-c9a0e36224b6eb2807bad0df2d5aa11bb05c8a32.tar.gz scala-c9a0e36224b6eb2807bad0df2d5aa11bb05c8a32.tar.bz2 scala-c9a0e36224b6eb2807bad0df2d5aa11bb05c8a32.zip |
[nomaster] Revert "refactors handling of parent types"
This reverts commit 40063b0009d55ed527bf1625d99a168a8faa4124.
Conflicts:
src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index c728185d4e..ab338447c9 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -857,8 +857,13 @@ trait Namers extends MethodSynthesis { private def templateSig(templ: Template): Type = { val clazz = context.owner def checkParent(tpt: Tree): Type = { - if (tpt.tpe.isError) AnyRefClass.tpe - else tpt.tpe + val tp = tpt.tpe + val inheritsSelf = tp.typeSymbol == owner + if (inheritsSelf) + InheritsItselfError(tpt) + + if (inheritsSelf || tp.isError) AnyRefClass.tpe + else tp } val parents = typer.parentTypes(templ) map checkParent |