From 67a7149766a81f2beb9e9ab37169b9c1957868af Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Thu, 24 May 2012 15:44:27 +0200 Subject: fix SI-5829: refinement typeref has a prefix --- src/compiler/scala/reflect/internal/Types.scala | 4 ++-- test/files/pos/t5829.scala | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 test/files/pos/t5829.scala diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala index 93f359ae12..cfc45695a7 100644 --- a/src/compiler/scala/reflect/internal/Types.scala +++ b/src/compiler/scala/reflect/internal/Types.scala @@ -1973,7 +1973,7 @@ trait Types extends api.Types { self: SymbolTable => require(sym.isPackageClass, sym) override protected def finishPrefix(rest: String) = packagePrefix + rest } - class RefinementTypeRef(sym0: Symbol) extends NoArgsTypeRef(NoType, sym0) with ClassTypeRef { + class RefinementTypeRef(pre0: Type, sym0: Symbol) extends NoArgsTypeRef(pre0, sym0) with ClassTypeRef { require(sym.isRefinementClass, sym) // I think this is okay, but see #1241 (r12414), #2208, and typedTypeConstructor in Typers @@ -2359,7 +2359,7 @@ trait Types extends api.Types { self: SymbolTable => else { if (sym.isAliasType) new NoArgsTypeRef(pre, sym) with AliasTypeRef else if (sym.isAbstractType) new NoArgsTypeRef(pre, sym) with AbstractTypeRef - else if (sym.isRefinementClass) new RefinementTypeRef(sym) + else if (sym.isRefinementClass) new RefinementTypeRef(pre, sym) else if (sym.isPackageClass) new PackageTypeRef(pre, sym) else if (sym.isModuleClass) new ModuleTypeRef(pre, sym) else new NoArgsTypeRef(pre, sym) with ClassTypeRef diff --git a/test/files/pos/t5829.scala b/test/files/pos/t5829.scala new file mode 100644 index 0000000000..236045ed11 --- /dev/null +++ b/test/files/pos/t5829.scala @@ -0,0 +1,18 @@ +trait Universe { + type Tree + + type SymTree <: Tree + type NameTree <: Tree + type RefTree <: SymTree with NameTree + + type Ident <: RefTree + type Select <: RefTree +} + +object Test extends App { + val universe: Universe = null + import universe._ + def select: Select = ??? + def ident: Ident = ??? + List(select, ident) +} \ No newline at end of file -- cgit v1.2.3