Skip to content

Commit

Permalink
fix SI-5829: refinement typeref has a prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaanm committed May 24, 2012
1 parent e490b02 commit 67a7149
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/scala/reflect/internal/Types.scala
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1973,7 +1973,7 @@ trait Types extends api.Types { self: SymbolTable =>
require(sym.isPackageClass, sym) require(sym.isPackageClass, sym)
override protected def finishPrefix(rest: String) = packagePrefix + rest 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) require(sym.isRefinementClass, sym)


// I think this is okay, but see #1241 (r12414), #2208, and typedTypeConstructor in Typers // I think this is okay, but see #1241 (r12414), #2208, and typedTypeConstructor in Typers
Expand Down Expand Up @@ -2359,7 +2359,7 @@ trait Types extends api.Types { self: SymbolTable =>
else { else {
if (sym.isAliasType) new NoArgsTypeRef(pre, sym) with AliasTypeRef if (sym.isAliasType) new NoArgsTypeRef(pre, sym) with AliasTypeRef
else if (sym.isAbstractType) new NoArgsTypeRef(pre, sym) with AbstractTypeRef 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.isPackageClass) new PackageTypeRef(pre, sym)
else if (sym.isModuleClass) new ModuleTypeRef(pre, sym) else if (sym.isModuleClass) new ModuleTypeRef(pre, sym)
else new NoArgsTypeRef(pre, sym) with ClassTypeRef else new NoArgsTypeRef(pre, sym) with ClassTypeRef
Expand Down
18 changes: 18 additions & 0 deletions test/files/pos/t5829.scala
Original file line number Original file line Diff line number Diff line change
@@ -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.