rust/src/test/compile-fail/trait-cast.rs
Tim Chevalier 62f98c8ff8 Preserve parenthesization in the AST
Maintain explicit "paren" nodes in the AST so we can pretty-print
without having to guess where parens should go. We may revisit this
in the future.

r=graydon
2012-10-30 15:05:32 -07:00

12 lines
357 B
Rust

trait foo<T> { }
fn bar(x: foo<uint>) -> foo<int> {
return (x as foo::<int>);
//~^ ERROR mismatched types: expected `@foo<int>` but found `@foo<uint>`
//~^^ ERROR mismatched types: expected `@foo<int>` but found `@foo<uint>`
// This is unfortunate -- new handling of parens means the error message
// gets printed twice
}
fn main() {}