Add test case that checks that class members must be prefixed with "self"
Closes #2289.
This commit is contained in:
parent
50ec6bd2c3
commit
95a2b5d42f
1 changed files with 15 additions and 0 deletions
15
src/test/compile-fail/class-missing-self.rs
Normal file
15
src/test/compile-fail/class-missing-self.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
class cat {
|
||||
priv {
|
||||
let mut meows : uint;
|
||||
fn sleep() { loop{} }
|
||||
fn meow() {
|
||||
#error("Meow");
|
||||
meows += 1u; //! ERROR unresolved name
|
||||
sleep(); //! ERROR unresolved name
|
||||
}
|
||||
}
|
||||
|
||||
new(in_x : uint) { self.meows = in_x; }
|
||||
}
|
||||
|
||||
fn main() { }
|
Loading…
Add table
Add a link
Reference in a new issue