mozilla/rust — Issue #1933: Bounds check error in rustc when using wildcard in alt-expression
Author: veddan
Created: 2012-03-06 14:42:21+00:00
State: open

When trying to compile this code

```
use std;

import core::option::{some, none};
import option = core::option;

type map = @mutable node;

enum node {
foo(int, option>)
}

fn f(m: map) -> option {
alt *m {
// if I change this to 'foo(x, y) { none }', it works
foo(x, _) { none }
}
}
```

i get the following error

rust: upcall fail 'bounds check', src/rustc/middle/ty.rs:2132

If I change the code as indicated in the comment, it compiles. Also, If I change just the enum declaration to

```
enum node {
foo(int, map)
}
```

it also compiles.