Closed
Description
Couldn't find another issue for this.
use self::MyEnum::*;
enum MyEnum {
Result,
NoResult
}
fn new() -> Result<MyEnum, String> {
unimplemented!()
}
fn main() {
let _ = new();
}
The error message for this is poor and should suggest qualifying the type, or at least clearly saying that a value from MyEnum
cannot be used as a type, and the span should then help the user understand (it is currently fine):
<anon>:6:13: 6:35 error: found value name used as a type: DefVariant(syntax::ast::DefId{krate: 0u32, node: 4u32}, syntax::ast::DefId{krate: 0u32, node: 5u32}, false)
<anon>:6 fn new() -> Result<MyEnum, String> {
^~~~~~~~~~~~~~~~~~~~~~
Error message comes from astconv, so we could probably catch this in resolve?