two more tests for method autoderef
This commit is contained in:
parent
773a640303
commit
de491ea707
@ -0,0 +1,8 @@
|
||||
impl methods for @@uint {
|
||||
fn double() -> uint { **self * 2u }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = @@@@@3u;
|
||||
assert x.double() == 6u;
|
||||
}
|
8
src/test/run-pass/autoderef-method-twice.rs
Normal file
8
src/test/run-pass/autoderef-method-twice.rs
Normal file
@ -0,0 +1,8 @@
|
||||
impl methods for uint {
|
||||
fn double() -> uint { self * 2u }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = @@3u;
|
||||
assert x.double() == 6u;
|
||||
}
|
Loading…
Reference in New Issue
Block a user