about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Clements <clements@racket-lang.org>2013-04-18 16:48:33 -0700
committerJohn Clements <clements@racket-lang.org>2013-04-30 16:31:55 -0700
commit178305ffecf4e183a425028ba53b39a4f4dd1121 (patch)
tree5ba8b573a8fc0e7ab33d5fe0dc8632d1c881ff8d
parentd6bb587c12da816b2872db1c1f9154a58fc91006 (diff)
downloadrust-178305ffecf4e183a425028ba53b39a4f4dd1121.tar.gz
rust-178305ffecf4e183a425028ba53b39a4f4dd1121.zip
fixed up issue-2185, but now it has a trait failure
-rw-r--r--src/test/run-pass/issue-2185.rs31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/test/run-pass/issue-2185.rs b/src/test/run-pass/issue-2185.rs
index ac680d3d12e..350dea4415d 100644
--- a/src/test/run-pass/issue-2185.rs
+++ b/src/test/run-pass/issue-2185.rs
@@ -8,22 +8,45 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// xfail-test FIXME #2263
+// does the second one subsume the first?
+// xfail-test
 // xfail-fast
+
+// notes on this test case:
+// On Thu, Apr 18, 2013 at 6:30 PM, John Clements <clements@brinckerhoff.org> wrote:
+// the "issue-2185.rs" test was xfailed with a ref to #2263. Issue #2263 is now fixed, so I tried it again, and after adding some &self parameters, I got this error:
+// 
+// Running /usr/local/bin/rustc:
+// issue-2185.rs:24:0: 26:1 error: conflicting implementations for a trait
+// issue-2185.rs:24 impl iterable<uint> for @fn(&fn(uint)) {
+// issue-2185.rs:25     fn iter(&self, blk: &fn(v: uint)) { self( |i| blk(i) ) }
+// issue-2185.rs:26 }
+// issue-2185.rs:20:0: 22:1 note: note conflicting implementation here
+// issue-2185.rs:20 impl<A> iterable<A> for @fn(&fn(A)) {
+// issue-2185.rs:21     fn iter(&self, blk: &fn(A)) { self(blk); }
+// issue-2185.rs:22 }
+// 
+// … so it looks like it's just not possible to implement both the generic iterable<uint> and iterable<A> for the type iterable<uint>. Is it okay if I just remove this test?
+//
+// but Niko responded:
+// think it's fine to remove this test, just because it's old and cruft and not hard to reproduce. *However* it should eventually be possible to implement the same interface for the same type multiple times with different type parameters, it's just that our current trait implementation has accidental limitations.
+
+// so I'm leaving it in.
+
 // This test had to do with an outdated version of the iterable trait.
 // However, the condition it was testing seemed complex enough to
 // warrant still having a test, so I inlined the old definitions.
 
 trait iterable<A> {
-    fn iter(blk: &fn(A));
+    fn iter(&self, blk: &fn(A));
 }
 
 impl<A> iterable<A> for @fn(&fn(A)) {
-    fn iter(blk: &fn(A)) { self(blk); }
+    fn iter(&self, blk: &fn(A)) { self(blk); }
 }
 
 impl iterable<uint> for @fn(&fn(uint)) {
-    fn iter(blk: &fn(&&v: uint)) { self( |i| blk(i) ) }
+    fn iter(&self, blk: &fn(v: uint)) { self( |i| blk(i) ) }
 }
 
 fn filter<A,IA:iterable<A>>(self: IA, prd: @fn(A) -> bool, blk: &fn(A)) {