Permalink
Browse files

fix SI-5829: refinement typeref has a prefix

  • Loading branch information...
adriaanm committed May 24, 2012
1 parent e490b02 commit 67a7149766a81f2beb9e9ab37169b9c1957868af
Showing with 20 additions and 2 deletions.
  1. +2 −2 src/compiler/scala/reflect/internal/Types.scala
  2. +18 −0 test/files/pos/t5829.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
View
@@ -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)
+}

0 comments on commit 67a7149

Please sign in to comment.