Enforce that self doesn't escape from a class

Closes #2294
This commit is contained in:
Tim Chevalier 2012-05-13 19:59:43 -07:00
parent 11e9947ff5
commit 89cd2f6bd0
4 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,6 @@
class cat {
fn kitty() -> cat { self } //! ERROR: can't return self or store it in a data structure
new() { }
}
fn main() {}