Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
14303bad89a049b5ca54ad49b4f4ccff7a06b85f
rust/src/test/run-pass/nested-class.rs

20 lines
266 B
Rust
Raw Normal View History

Fix resolve bug that made nested classes not work It wasn't possible to refer to the constructor for a class nested inside an item from the class's outer scope. Fixed.
2012-06-19 12:00:09 -07:00
fn main() {
Remove the class keyword
2012-08-15 18:46:55 -07:00
struct b {
Fix resolve bug that made nested classes not work It wasn't possible to refer to the constructor for a class nested inside an item from the class's outer scope. Fixed.
2012-06-19 12:00:09 -07:00
let i: int;
Convert ret to return
2012-08-01 17:30:05 -07:00
fn do_stuff() -> int { return 37; }
Fix resolve bug that made nested classes not work It wasn't possible to refer to the constructor for a class nested inside an item from the class's outer scope. Fixed.
2012-06-19 12:00:09 -07:00
}
Remove struct ctors
2012-09-05 15:58:43 -07:00
fn b(i:int) -> b {
b {
i: i
}
}
Fix resolve bug that made nested classes not work It wasn't possible to refer to the constructor for a class nested inside an item from the class's outer scope. Fixed.
2012-06-19 12:00:09 -07:00
// fn b(x:int) -> int { fail; }
let z = b(42);
assert(z.i == 42);
assert(z.do_stuff() == 37);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 242ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API