Skip to content

Commit 8bb3a01

Browse files
committed
Add in missing [] methods to some tests.
1 parent df9b43e commit 8bb3a01

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/test/run-pass/class-impl-parameterized-iface.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class cat : map<int, bool> {
4242
}
4343
fn contains_key(&&k: int) -> bool { k <= self.meows }
4444
fn get(&&k:int) -> bool { k <= self.meows }
45+
fn [](&&k:int) -> bool { k <= self.meows }
4546
fn find(&&k:int) -> option<bool> { some(self.get(k)) }
4647
fn remove(&&k:int) -> option<bool> { self.meows -= k; some(true) }
4748
fn each(f: fn(&&int, &&bool) -> bool) {

src/test/run-pass/class-impl-very-parameterized-iface.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class cat<T: copy> : map<int, T> {
5252
none { fail "epic fail"; }
5353
}
5454
}
55+
fn [](&&k:int) -> T { get(k) }
5556
fn find(&&k:int) -> option<T> { if k <= self.meows {
5657
some(self.name)
5758
}

0 commit comments

Comments
 (0)