From c2175ec910165308e81c48bd8ca8910c50862be4 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 28 May 2014 11:27:11 +0200 Subject: Avoid classtype checking for refinements. In a refinement type T { R } we do not need T to be a class. But analyzing the refeinement type will create a temporary class type. This refinement class has to be treated specially in what concerns parent types. --- src/dotty/tools/dotc/typer/Namer.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/typer/Namer.scala') diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index e9195a072..681523bd2 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -459,7 +459,8 @@ class Namer { typer: Typer => def checkedParentType(parent: untpd.Tree): Type = { val ptype = parentType(parent)(ctx.fresh addMode Mode.InSuperCall) - checkClassTypeWithStablePrefix(ptype, parent.pos, traitReq = parent ne parents.head) + if (cls.isRefinementClass) ptype + else checkClassTypeWithStablePrefix(ptype, parent.pos, traitReq = parent ne parents.head) } val selfInfo = -- cgit v1.2.3