1a96e79fe0
The typechecker had a number of special cases for unifying types with _|_ (as with checking if and alt). But, a value of type _|_ should be usable in any context, as such a value always diverges, and will never be used by its immediate context. Changed unify accordingly, removed special cases.
15 lines
191 B
Rust
15 lines
191 B
Rust
// xfail-stage0
|
|
use std;
|
|
import std::option::*;
|
|
|
|
fn main() {
|
|
let int i = alt (some[int](3)) {
|
|
case (none[int]) {
|
|
fail
|
|
}
|
|
case (some[int](_)) {
|
|
5
|
|
}
|
|
};
|
|
log i;
|
|
} |