2012-12-06 12:12:55 -08:00
|
|
|
// error-pattern: instantiating a type parameter with an incompatible type
|
2011-09-28 14:37:28 -07:00
|
|
|
|
2012-08-15 18:46:55 -07:00
|
|
|
struct r {
|
2012-11-15 19:01:44 -08:00
|
|
|
i:int
|
2012-11-14 01:22:37 -05:00
|
|
|
}
|
|
|
|
|
2012-11-15 19:01:44 -08:00
|
|
|
fn r(i:int) -> r { r { i: i } }
|
|
|
|
|
2012-11-14 01:22:37 -05:00
|
|
|
impl r : Drop {
|
2012-11-28 15:42:16 -08:00
|
|
|
fn finalize(&self) {}
|
2012-06-01 20:21:59 -07:00
|
|
|
}
|
2011-09-28 14:37:28 -07:00
|
|
|
|
|
|
|
fn main() {
|
2012-06-01 20:21:59 -07:00
|
|
|
// This can't make sense as it would copy the classes
|
2012-10-23 11:11:23 -07:00
|
|
|
let i = move ~[r(0)];
|
|
|
|
let j = move ~[r(1)];
|
2011-09-28 14:37:28 -07:00
|
|
|
let k = i + j;
|
2011-12-22 17:53:53 -08:00
|
|
|
log(debug, j);
|
2011-11-18 12:39:20 +01:00
|
|
|
}
|