2012-06-29 18:26:56 -05:00
|
|
|
fn wants_box(x: @[uint]) { }
|
|
|
|
fn wants_uniq(x: ~[uint]) { }
|
2012-04-14 20:45:03 -05:00
|
|
|
fn wants_three(x: [uint]/3) { }
|
|
|
|
|
2012-06-29 18:26:56 -05:00
|
|
|
fn has_box(x: @[uint]) {
|
2012-04-14 20:45:03 -05:00
|
|
|
wants_box(x);
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found @
|
|
|
|
wants_three(x); //~ ERROR [] storage differs: expected 3 but found @
|
2012-04-14 20:45:03 -05:00
|
|
|
}
|
|
|
|
|
2012-06-29 18:26:56 -05:00
|
|
|
fn has_uniq(x: ~[uint]) {
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_box(x); //~ ERROR [] storage differs: expected @ but found ~
|
2012-04-14 20:45:03 -05:00
|
|
|
wants_uniq(x);
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_three(x); //~ ERROR [] storage differs: expected 3 but found ~
|
2012-04-14 20:45:03 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn has_three(x: [uint]/3) {
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_box(x); //~ ERROR [] storage differs: expected @ but found 3
|
|
|
|
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 3
|
2012-04-14 20:45:03 -05:00
|
|
|
wants_three(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn has_four(x: [uint]/4) {
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_box(x); //~ ERROR [] storage differs: expected @ but found 4
|
|
|
|
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 4
|
|
|
|
wants_three(x); //~ ERROR [] storage differs: expected 3 but found 4
|
2012-04-14 20:45:03 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|