diff options
author | Martin Odersky <odersky@gmail.com> | 2006-07-24 14:22:00 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-07-24 14:22:00 +0000 |
commit | 5bdedbd45315a010ad852b5f2b12715a824fee26 (patch) | |
tree | fd075aaa156ca6951799fac224fba231b45197c8 /test/files/pos/viewtest3.scala | |
parent | 343c15fe833dc763750f8ed3ba65e9458da09d05 (diff) | |
download | scala-5bdedbd45315a010ad852b5f2b12715a824fee26.tar.gz scala-5bdedbd45315a010ad852b5f2b12715a824fee26.tar.bz2 scala-5bdedbd45315a010ad852b5f2b12715a824fee26.zip |
Diffstat (limited to 'test/files/pos/viewtest3.scala')
-rw-r--r-- | test/files/pos/viewtest3.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/files/pos/viewtest3.scala b/test/files/pos/viewtest3.scala index 68277a7a47..aa7b2ec539 100644 --- a/test/files/pos/viewtest3.scala +++ b/test/files/pos/viewtest3.scala @@ -1,17 +1,18 @@ package testview; trait Tree[+a <% Ordered[a]] { - def insert[b >: a <% Ordered[b]](x: b): Tree[b]; + def insert[c >: b, b >: a <: c](x: b)(implicit d: c => Ordered[c]): Tree[b] def elements: List[a] } object Empty extends Tree[All] { - def insert[b >: All <% Ordered[b]](x: b): Tree[b] = new Node(x, Empty, Empty); + def insert[c >: b, b >: a <: c](x: b)(implicit d: c => Ordered[c]): Tree[b] = + new Node(x, Empty, Empty); def elements: List[All] = List(); } class Node[a <% Ordered[a]](elem: a, l: Tree[a], r: Tree[a]) extends Tree[a] { - def insert[b >: a <% Ordered[b]](x: b): Tree[b] = + def insert[c >: b, b >: a <: c](x: b)(implicit d: c => Ordered[c]): Tree[b] = if (x == elem) this else if (x < elem) new Node(elem, l insert x, r) else new Node(elem, l, r insert x); |