-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Description
If a struct is defined elsewhere, it won't get resolved in a pattern match. @pcwalton
Testcase
fn main() {
let sears = buildings::Tower { height: 1451 };
let h: uint = match sears {
::buildings::Tower { height: h } => { h }
};
io::println(h.to_str());
}
mod buildings {
struct Tower { height: uint }
}
Error
test.rs:2:16: 2:32 error: `buildings::Tower` does not name a structure
test.rs:2 let sears = buildings::Tower { height: 1451 };
^~~~~~~~~~~~~~~~
test.rs:5:8: 5:26 error: `buildings::Tower` does not name a structure
test.rs:5 ::buildings::Tower { height: h } => { h }
^~~~~~~~~~~~~~~~~~
test.rs:5:37: 5:38 error: unresolved name: h
test.rs:5 ::buildings::Tower { height: h } => { h }
^
test.rs:5:46: 5:47 error: unresolved name: h
test.rs:5 ::buildings::Tower { height: h } => { h }
Metadata
Metadata
Assignees
Labels
No labels