Support explicit discriminant numbers on tag variants.
Addresses issue #1393. For now disallow disr. values unless all variants use nullary contractors (i.e. "enum-like"). Disr. values are now encoded in the crate metadata, but only when it will differ from the inferred value based on the order.
This commit is contained in:
parent
d0fe6723fc
commit
08abf8d37f
12 changed files with 167 additions and 30 deletions
|
|
@ -416,7 +416,8 @@ type native_mod =
|
|||
|
||||
type variant_arg = {ty: @ty, id: node_id};
|
||||
|
||||
type variant_ = {name: ident, args: [variant_arg], id: node_id};
|
||||
type variant_ = {name: ident, args: [variant_arg], id: node_id,
|
||||
disr_val: int, disr_expr: option::t<@expr>};
|
||||
|
||||
type variant = spanned<variant_>;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue