Introduce a T_err type for type errors
This allows more errors to be non-fatal, as per #1871. I only went through and started changing span_fatal to span_err in check.rs. There are probably more errors that could be made non-fatal. So if you see derived type errors appearing from now on, file a bug! r=graydon Closes #1871
This commit is contained in:
parent
77ef4e7176
commit
ef833d4101
15 changed files with 256 additions and 146 deletions
|
|
@ -1,2 +1,2 @@
|
|||
// error-pattern: cast from nil: () as u32
|
||||
// error-pattern: cast from nil: `()` as `u32`
|
||||
fn main() { let u = (assert true) as u32; }
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
// error-pattern: cast to nil: u32 as ()
|
||||
// error-pattern: cast to nil: `u32` as `()`
|
||||
fn main() { let u = 0u32 as (); }
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// error-pattern:expected function or foreign function but found *u8
|
||||
// error-pattern:expected function or foreign function but found `*u8`
|
||||
extern fn f() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
// xfail-test
|
||||
// Tests that we don't generate a spurious error about f.honk's type
|
||||
// being undeterminable
|
||||
fn main() {
|
||||
let f = 42;
|
||||
|
||||
let _g = if f < 5 {
|
||||
f.honk();
|
||||
f.honk() //~ ERROR attempted access of field `honk`
|
||||
}
|
||||
else {
|
||||
12
|
||||
()
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@ impl<A> ~[A]: vec_monad<A> {
|
|||
}
|
||||
}
|
||||
fn main() {
|
||||
["hi"].bind({|x| [x] });
|
||||
["hi"].bind({|x| [x] }); //~ ERROR attempted access of field `bind`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue