Don't evaluate discriminator value constants when parsing.

Remove disr_val from ast::variant_ and always use ty::variant_info
when the value is needed.  Move what was done during parsing into
other passes, primary typeck.rs.  This move also correctly type checks
the disr. value expression; thus, fixing rustc --pretty=typed when
disr. values are used.
This commit is contained in:
Kevin Atkinson 2012-01-16 02:36:47 -07:00 committed by Marijn Haverbeke
parent edf11ebf02
commit e1c50c4410
10 changed files with 106 additions and 51 deletions

View file

@ -409,7 +409,7 @@ type native_mod =
type variant_arg = {ty: @ty, id: node_id};
type variant_ = {name: ident, args: [variant_arg], id: node_id,
disr_val: int, disr_expr: option::t<@expr>};
disr_expr: option::t<@expr>};
type variant = spanned<variant_>;