diff --git a/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs new file mode 100644 index 00000000000..4c15661e8f0 --- /dev/null +++ b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs @@ -0,0 +1,8 @@ +impl methods for @@uint { + fn double() -> uint { **self * 2u } +} + +fn main() { + let x = @@@@@3u; + assert x.double() == 6u; +} diff --git a/src/test/run-pass/autoderef-method-twice.rs b/src/test/run-pass/autoderef-method-twice.rs new file mode 100644 index 00000000000..3587e1d83a1 --- /dev/null +++ b/src/test/run-pass/autoderef-method-twice.rs @@ -0,0 +1,8 @@ +impl methods for uint { + fn double() -> uint { self * 2u } +} + +fn main() { + let x = @@3u; + assert x.double() == 6u; +}