remove leading ::, new tests

This commit is contained in:
Niko Matsakis 2012-02-11 17:14:29 -08:00
parent bcbe36b33b
commit a7641e99e8
5 changed files with 26 additions and 3 deletions

View file

@ -17,7 +17,7 @@ fn path_to_str_with_sep(p: path, sep: str) -> str {
}
fn path_to_str(p: path) -> str {
"::" + path_to_str_with_sep(p, "::")
path_to_str_with_sep(p, "::")
}
enum ast_node {

View file

@ -3,5 +3,5 @@
fn main() {
let x: option<uint>;
x = 5;
//!^ ERROR mismatched types: expected `::core::option::t<uint>`
//!^ ERROR mismatched types: expected `core::option::t<uint>`
}

View file

@ -10,7 +10,7 @@ mod y {
fn bar(x: x::foo) -> y::foo {
ret x;
//!^ ERROR mismatched types: expected `::y::foo` but found `::x::foo`
//!^ ERROR mismatched types: expected `y::foo` but found `x::foo`
}
fn main() {

View file

@ -0,0 +1,12 @@
// Test that we use fully-qualified type names in error messages.
type T1 = uint;
type T2 = int;
fn bar(x: T1) -> T2 {
ret x;
//!^ ERROR mismatched types: expected `T2` but found `T1`
}
fn main() {
}

View file

@ -0,0 +1,11 @@
// Test that we use fully-qualified type names in error messages.
import core::task::task;
fn bar(x: uint) -> task {
ret x;
//!^ ERROR mismatched types: expected `core::task::task`
}
fn main() {
}