Improve type error message for non-constructor in pattern

This commit is contained in:
Tim Chevalier 2011-06-01 18:15:12 -07:00
parent 1402cd101b
commit 24c9d7e5f8

View File

@ -1128,8 +1128,8 @@ fn pushdown_pat(&@stmt_ctxt scx, &ty::t expected, &@ast::pat pat) {
alt (struct(scx.fcx.ccx.tcx, expected)) {
case (ty::ty_tag(_, ?tps)) { tag_tps = tps; }
case (_) {
log_err "tag pattern type not actually a tag?!";
fail;
scx.fcx.ccx.tcx.sess.span_err(pat.span,
"Non-constructor used in a pattern");
}
}