rust/src/test/compile-fail/regions-iface-3.rs
Niko Matsakis 825fd1808e lots of work to make iface/impls parameterized by regions
- paths can now take region parameters, replacing the dirty hack
  I was doing before of abusing vstores.  vstores are now a bit
  of a hack though.

- fix various small bugs:
  - we never checked that iface types were compatible when casting
    to an iface with `as`
  - we allowed nonsense like int<int>
  - and more! (actually that may be it)
2012-04-25 19:26:56 -07:00

15 lines
355 B
Rust

iface get_ctxt/& {
fn get_ctxt() -> &self.uint;
}
fn make_gc1(gc: get_ctxt/&a) -> get_ctxt/&b {
ret gc; //! ERROR mismatched types: expected `get_ctxt/&b` but found `get_ctxt/&a`
}
fn make_gc2(gc: get_ctxt/&a) -> get_ctxt/&b {
ret gc as get_ctxt; //! ERROR mismatched types: expected `get_ctxt/&b` but found `get_ctxt/&a`
}
fn main() {
}