Unique names for polymorphic types
This commit is contained in:
@@ -24,9 +24,21 @@ Array :: struct($T: Type)
|
||||
len: int
|
||||
cap: int
|
||||
|
||||
make_array :: (a: *int, count: int): Array(int)
|
||||
result := Array(int) {
|
||||
data = a,
|
||||
len = count,
|
||||
cap = count
|
||||
}
|
||||
return result
|
||||
|
||||
|
||||
main :: (argc: int, argv: **char): int
|
||||
array: Array(int)
|
||||
buff: *int
|
||||
array: Array(int) = {len = 10, cap = 10, data = buff}
|
||||
second_array: Array(int)
|
||||
third_array: Array(int)
|
||||
fourth: Array(F32)
|
||||
fifth: Array(F32)
|
||||
|
||||
return 0
|
||||
Reference in New Issue
Block a user