Skip to content

Instantly share code, notes, and snippets.

@nikomatsakis
Created March 26, 2012 19:37
Show Gist options
  • Save nikomatsakis/2209065 to your computer and use it in GitHub Desktop.
Save nikomatsakis/2209065 to your computer and use it in GitHub Desktop.
impl y for option<int> {
fn hi() { io::print("int"); }
}
impl x for option<uint> {
fn hi() { io::print("uint"); }
}
fn to_uint(x: option<uint>) {}
fn main() {
let x = none;
x.hi(); // unifies x with <int>...
to_uint(x); // ...thus failing here.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment