added generics ast

This commit is contained in:
2026-01-20 17:47:36 -07:00
parent e7eb194b6c
commit 8f6200f393
4 changed files with 142 additions and 25 deletions

View File

@@ -2,11 +2,11 @@ type MyTrait trait {}
type Pair[K, V: MyTrait] struct {
k: K,
v: V,
v: V
}
type Value struct {
value: i64,
value: i64
}
impl MyTrait for Value {}
@@ -21,7 +21,7 @@ impl [K, V: MyTrait] Pair[K, V] {
fn main(): i64 {
let a = Pair[i64, Value]{
k: 4,
v: Value{value: 6},
v: Value{value: 6}
};
return a.get_value[i64](999).value;
}