On 3/22/13 5:10 PM, Martin DeMello wrote:
Since this is breaking everything anyway, how about syntax to let the
match run inside the enum namespace? e.g.

  enum Color { Red, Green, Blue }
     fn main() {
         let x = Color::Red;
         match Color::{x} {
             Red => ...
             Green => ...
             Blue => ...
         }
     }

Seems to add complexity to the grammar for something that could be done with `use self::Color::*;`

Or even infer that x is of type Color and let the compiler
transparently allow omitting the prefix within the match.

That would intertwine name resolution and typechecking, which would add a lot of complexity to the compiler (if it's even coherent to do so; it might not be).

Patrick

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to