Closed
Description
Trying to compile this
enum Node<T> {
Empty,
Leaf(T),
}
impl<T> Node<T> {
fn new() -> @Node<T> {
@Empty
}
}
fn main() {
let n = Node::new();
}
Errors out with this
$ rustc construct.rs
construct.rs:13:12: 13:21 error: unresolved name
construct.rs:13 let n = Node::new();
^~~~~~~~~
construct.rs:13:12: 13:21 error: use of undeclared module `Node`
construct.rs:13 let n = Node::new();
^~~~~~~~~
construct.rs:13:12: 13:21 error: unresolved name: Node::new
construct.rs:13 let n = Node::new();
^~~~~~~~~
error: aborting due to 3 previous errors