diff options
author | Martin Odersky <odersky@gmail.com> | 2006-07-14 13:18:32 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-07-14 13:18:32 +0000 |
commit | f964ab66d62b7cee249d89989831f7cd74c76f0a (patch) | |
tree | c7ff75d2bb7770c5ff9edbe50d52b0b0255f7204 /test/files | |
parent | c755b6a62e87d2ef7fe77ead9c6dd76ed096089e (diff) | |
download | scala-f964ab66d62b7cee249d89989831f7cd74c76f0a.tar.gz scala-f964ab66d62b7cee249d89989831f7cd74c76f0a.tar.bz2 scala-f964ab66d62b7cee249d89989831f7cd74c76f0a.zip |
fixed bug657.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/bug657.check | 1 | ||||
-rw-r--r-- | test/files/run/bug657.scala | 51 |
2 files changed, 52 insertions, 0 deletions
diff --git a/test/files/run/bug657.check b/test/files/run/bug657.check new file mode 100644 index 0000000000..b0aad4deb5 --- /dev/null +++ b/test/files/run/bug657.check @@ -0,0 +1 @@ +passed diff --git a/test/files/run/bug657.scala b/test/files/run/bug657.scala new file mode 100644 index 0000000000..931f62b1a5 --- /dev/null +++ b/test/files/run/bug657.scala @@ -0,0 +1,51 @@ +abstract class BaseList { + type Node <: NodeImpl; + implicit def convertNode(ni : NodeImpl) = ni.asInstanceOf[Node]; + abstract class NodeImpl; +} +abstract class LinkedList extends BaseList { + type Node <: NodeImpl; + trait NodeImpl extends super.NodeImpl; +} +trait OffsetList extends LinkedList { + type Node <: NodeImpl; + trait NodeImpl extends super.NodeImpl; +} + +trait PriorityTree extends BaseList { + type Node <: NodeImpl; + trait NodeImpl extends super.NodeImpl { + def chop : Node = this; + } +} + +trait PrecedenceParser extends LinkedList with PriorityTree { + type Node <: NodeImpl; + trait NodeImpl extends super[LinkedList].NodeImpl with super[PriorityTree].NodeImpl; +} + +trait Matcher extends PrecedenceParser { + type Node <: NodeImpl; + trait NodeImpl extends super.NodeImpl; + + type Matchable <: Node with MatchableImpl; + implicit def convertMatchable(m : MatchableImpl) = m.asInstanceOf[Matchable]; + trait MatchableImpl extends NodeImpl { + override def chop : Node = { + Console.println("passed"); super.chop; + } + } +} + +class Test1 extends OffsetList with Matcher { + type Node = NodeImpl; + trait NodeImpl extends super[OffsetList].NodeImpl with super[Matcher].NodeImpl; + class MatchableImpl extends super.MatchableImpl with NodeImpl; + type Matchable = MatchableImpl; +} + +object Test extends Application { + val test = new Test1; + val m = new test.MatchableImpl; + m.chop; +} |