Created
September 26, 2012 23:08
-
-
Save burg/3791204 to your computer and use it in GitHub Desktop.
test case for mozilla/rust issue #3601
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct HTMLImageData { | |
mut image: Option<~str> | |
} | |
struct ElementData { | |
kind: ~ElementKind | |
} | |
enum ElementKind { | |
HTMLImageElement(HTMLImageData) | |
} | |
enum NodeKind { | |
Element(ElementData) | |
} | |
enum NodeData = { | |
kind: ~NodeKind | |
}; | |
fn main() { | |
let id = HTMLImageData { image: None }; | |
let ed = ElementData { kind: ~HTMLImageElement(id) }; | |
let n = NodeData({kind : ~Element(ed)}); | |
match n.kind { | |
~Element(ed) => match ed.kind { | |
~HTMLImageElement(d) if d.image.is_some() => { true } | |
}, | |
_ => fail ~"WAT" | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment