aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/expr-alt-box.rs
blob: e18611fa96ff7f706d8bc6f754c65593974db4c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// xfail-boot
// -*- rust -*-

// Tests for alt as expressions resulting in boxed types

fn test_box() {
  auto res = alt (true) {
    case (true) {
      @100
    }
  };
  assert (*res == 100);
}

fn test_str() {
  auto res = alt (true) {
    case (true) {
      "happy"
    }
  };
  assert (res == "happy");
}

fn main() {
  test_box();
  test_str();
}