summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala2
-rw-r--r--test/files/pos/bug591.scala41
-rw-r--r--test/pending/run/subarray.scala8
3 files changed, 43 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
index 12b3b79083..4524157ce5 100644
--- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
+++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
@@ -75,6 +75,8 @@ abstract class ExplicitOuter extends InfoTransform {
private def outerMember(tp: Type): Symbol = {
var e = tp.symbol.info.decls.elems;
+ // note: tp.decls does not work here, because tp might be a ThisType, in which case
+ // its decls would be the decls of the required type of the class.
while (e != null && !(e.sym.originalName.startsWith(nme.OUTER) && (e.sym hasFlag ACCESSOR)))
e = e.next;
assert(e != null, tp);
diff --git a/test/files/pos/bug591.scala b/test/files/pos/bug591.scala
new file mode 100644
index 0000000000..94d8068bb3
--- /dev/null
+++ b/test/files/pos/bug591.scala
@@ -0,0 +1,41 @@
+abstract class BaseList {
+ type Node <: BaseNode;
+
+
+ abstract class BaseNode {
+ protected def self : Node;
+ private[BaseList] def self00 = self;
+ def dirty : Unit = {}
+ def replaceWith(node : Node) = {}
+ }
+
+ implicit def baseNode2Node(bnode : BaseNode): Node = bnode.self00;
+
+
+}
+
+
+trait BaseFlow extends BaseList {
+ type Node <: BFNode;
+ type Flow <: FlowBase;
+ type Output <: OutputBase;
+ type Input <: InputBase;
+
+ abstract class FlowBase {
+
+ }
+ trait OutputBase extends FlowBase {
+
+ }
+ trait InputBase extends FlowBase {
+
+ }
+
+ trait BFNode extends BaseNode {
+ private var input : Input = null;
+ private var output : Output = null;
+
+ def input_=(in : Input) = {}
+
+ }
+}
diff --git a/test/pending/run/subarray.scala b/test/pending/run/subarray.scala
deleted file mode 100644
index b120f47338..0000000000
--- a/test/pending/run/subarray.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-object Test {
- def main(args: Array[String]): Unit = {
- val array = Array("one", "two", "three")
- val firstTwo: Array[String] = array.subArray(0,2)
- for(val x <- firstTwo)
- Console.println(x)
- }
-}