diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-09-05 18:30:01 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-10-31 12:30:09 +0200 |
| commit | fed864bf018e7d97fda24089ebe08fa0da1c3b97 (patch) | |
| tree | 709dddea28995c58931f28a69525258129aa2fef /tests/structs.ek | |
| parent | a06ed46bffa94e4613052e0ddf0cb70ab32651ab (diff) | |
| download | ek-fed864bf018e7d97fda24089ebe08fa0da1c3b97.tar.gz ek-fed864bf018e7d97fda24089ebe08fa0da1c3b97.zip | |
more or less happy with syntax
Diffstat (limited to 'tests/structs.ek')
| -rw-r--r-- | tests/structs.ek | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/structs.ek b/tests/structs.ek index 20d9c48..1444d24 100644 --- a/tests/structs.ek +++ b/tests/structs.ek @@ -1,26 +1,26 @@ typedef any {} struct basic_struct { - a i64; - b i64; - c i64; + i64 a; + i64 b; + i64 c; } -struct complex_struct (A any, B any, C any) { - a A; - b B; - c C; +struct complex_struct (any A, any B, any C) { + A a; + B b; + C c; } main() { /* infer types */ - simple_named const = {.a = 1, .b = 2, .c = 3} as basic_struct; - complex_named const = {.a = 1, .b = 2, .c = 3} as complex_struct; + const simple_named = {.a = 1, .b = 2, .c = 3} as basic_struct; + const complex_named = {.a = 1, .b = 2, .c = 3} as complex_struct; /* force types */ - force_named complex_struct![u32, u32, u32] = {.a = 1, .b = 2, .c = 3}; - force_inferred_named mut = {.a = 1, .b = 2, .c = 3} as + complex_struct![u32, u32, u32] force_named = {.a = 1, .b = 2, .c = 3}; + mut force_inferred_named = {.a = 1, .b = 2, .c = 3} as complex_struct![u32, u32, u32]; /* types should be inferred */ |
