INITIAL GENERICS IMPL
This commit is contained in:
@@ -44,6 +44,7 @@ fn start() {
|
||||
print("test: 0x");
|
||||
print_hex(31);
|
||||
println("");
|
||||
generic();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -74,6 +75,23 @@ fn structer(test: Test) {
|
||||
println("");
|
||||
}
|
||||
|
||||
struct GTest<T, U> {
|
||||
a: T,
|
||||
b: U,
|
||||
}
|
||||
|
||||
fn generic() {
|
||||
let gt = GTest {
|
||||
a: 39,
|
||||
b: "hello",
|
||||
};
|
||||
print("generic: ");
|
||||
print_dec(gt.a);
|
||||
print(", ");
|
||||
print(gt.b);
|
||||
println("");
|
||||
}
|
||||
|
||||
fn thinger() {
|
||||
print("estamos jugando\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user