summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-05-24 15:44:27 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-05-24 15:44:27 +0200
commit67a7149766a81f2beb9e9ab37169b9c1957868af (patch)
tree73793c655bbc50aabed17fe5eaa78b59af702e2f
parente490b02476769310765a8d61da656b535d21c56e (diff)
downloadscala-67a7149766a81f2beb9e9ab37169b9c1957868af.tar.gz
scala-67a7149766a81f2beb9e9ab37169b9c1957868af.tar.bz2
scala-67a7149766a81f2beb9e9ab37169b9c1957868af.zip
fix SI-5829: refinement typeref has a prefix
-rw-r--r--src/compiler/scala/reflect/internal/Types.scala4
-rw-r--r--test/files/pos/t5829.scala18
2 files changed, 20 insertions, 2 deletions
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