rustc: Emit a better error message when a type is used where a value was expected

This commit is contained in:
Patrick Walton 2011-03-24 10:24:37 -07:00
parent 8d8a48cfc4
commit 2c21195b21

View File

@ -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");