summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index b20ef3cd4e..d87a30f847 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -2312,7 +2312,9 @@ A type's typeSymbol should never be inspected directly.
/** The canonical creator for this-types */
def mkThisType(sym: Symbol): Type = {
- if (phase.erasedTypes) sym.tpe else unique(new ThisType(sym) with UniqueType)
+ if (!phase.erasedTypes) unique(new ThisType(sym) with UniqueType)
+ else if (sym.isImplClass) sym.typeOfThis
+ else sym.tpe
}
/** The canonical creator for single-types */
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 19eb2c90af..2acc09b70e 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -422,6 +422,7 @@ trait Contexts { self: Analyzer =>
||
(accessWithin(ab) || accessWithin(ab.linkedClassOfClass)) &&
(!sym.hasFlag(LOCAL) ||
+ sym.owner.isImplClass || // allow private local accesses to impl classes
(sym hasFlag PROTECTED) && isSubThisType(pre, sym.owner) ||
pre =:= sym.owner.thisType)
||