Created
September 4, 2013 03:01
-
-
Save Mr-Byte/6432320 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Blorp | |
{ | |
bar: ~int | |
} | |
impl Blorp | |
{ | |
fn wrap(value: ~int) -> Blorp | |
{ | |
Blorp { bar: value } | |
} | |
} | |
type Blurp = Blorp; | |
struct Foo<T> | |
{ | |
bar: ~T | |
} | |
impl<T> Foo<T> | |
{ | |
fn wrap(value: ~T) -> Foo<T> | |
{ | |
Foo { bar: value } | |
} | |
} | |
type Baz = Foo<int>; | |
fn main() | |
{ | |
let blorpA = Blorp::wrap(~50); //Compiles | |
let blorpB = Blurp::wrap(~50); //Fails | |
let bazA: Baz = Foo::wrap(~50); //Compiles | |
let bazB: Baz = Foo::<int>::wrap(~50); //Compiles | |
let bazC: Baz = Baz::wrap(~50); //Fails | |
} |
Author
Mr-Byte
commented
Sep 4, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment