diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-01-12 16:23:24 -0800 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-01-12 16:51:07 -0800 |
| commit | 565ea068ca6deb50c5866475508c538dc7e3acee (patch) | |
| tree | 50588ed6241d1970e10faf04bf1d3653ff7d1327 /src/test | |
| parent | 8818f42b19efbf8832c856058519644a8657b04c (diff) | |
| download | rust-565ea068ca6deb50c5866475508c538dc7e3acee.tar.gz rust-565ea068ca6deb50c5866475508c538dc7e3acee.zip | |
Add type parameters when checking wildcard patterns
For some reason, wildcard patterns were never getting type parameter substitutions attached. This would cause an assertion failure when checking a wildcard pattern that matches against a tag with polymorphic type (not sure why this didn't come up before). Fixed it. (The diff and test case may be easier to understand than this note :P) Closes #1503.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-fail/alt-wildcards.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/run-fail/alt-wildcards.rs b/src/test/run-fail/alt-wildcards.rs new file mode 100644 index 00000000000..4d89679e70e --- /dev/null +++ b/src/test/run-fail/alt-wildcards.rs @@ -0,0 +1,9 @@ +// error-pattern:squirrelcupcake +fn cmp() -> int { + alt(option::some('a'), option::none::<char>) { + (option::some(_), _) { fail "squirrelcupcake"; } + (_, option::some(_)) { fail; } + } +} + +fn main() { log(error, cmp()); } |
