diff --git a/src/test/run-pass/traits-default-method-trivial.rs b/src/test/run-pass/traits-default-method-trivial.rs new file mode 100644 index 000000000000..5c91d39f28f9 --- /dev/null +++ b/src/test/run-pass/traits-default-method-trivial.rs @@ -0,0 +1,20 @@ +//xfail-test + +trait Cat { + fn meow() -> bool; + fn scratch() -> bool; + fn purr() -> bool { true } +} + +impl int : Cat { + fn meow() -> bool { + self.scratch() + } + fn scratch() -> bool { + self.purr() + } +} + +fn main() { + assert 5.meow(); +}