diff options
| author | Patrick Walton <[email protected]> | 2011-03-24 10:24:37 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-03-24 10:29:15 -0700 |
| commit | 2c21195b216a93b8a97de1cab45da76ddb24b90b (patch) | |
| tree | e8b63131b39aa625152dc33d9669ba7221f35e5f /src/comp/middle | |
| parent | rustc: Don't try to export symbols for crazy architectures from rustllvm.dll.... (diff) | |
| download | rust-2c21195b216a93b8a97de1cab45da76ddb24b90b.tar.xz rust-2c21195b216a93b8a97de1cab45da76ddb24b90b.zip | |
rustc: Emit a better error message when a type is used where a value was expected
Diffstat (limited to 'src/comp/middle')
| -rw-r--r-- | src/comp/middle/typeck.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index a52b39e2..47ef81c1 100644 --- a/src/comp/middle/typeck.rs +++ b/src/comp/middle/typeck.rs @@ -184,6 +184,11 @@ fn ty_params_and_ty_for_def(@fn_ctxt fcx, &ast.def defn) ret tup(none[vec[ast.def_id]], plain_ty(ty.ty_nil)); } + case (ast.def_ty(_)) { + fcx.ccx.sess.err("expected value but found type"); + fail; + } + case (_) { // FIXME: handle other names. fcx.ccx.sess.unimpl("definition variant"); |