diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-04-01 14:35:51 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-04-01 14:35:51 +0300 |
| commit | 0132be5b71f3fe161b2fcda201c945d30bd8d1a5 (patch) | |
| tree | c31e766848311da0feccd360ca3659dc9e46a38a /tests/resolve.cu | |
| parent | ad18c24e7223b1c0d48a20ba9b618c4eaf1e3a84 (diff) | |
| download | ek-0132be5b71f3fe161b2fcda201c945d30bd8d1a5.tar.gz ek-0132be5b71f3fe161b2fcda201c945d30bd8d1a5.zip | |
improve struct and union support in resolve
Diffstat (limited to 'tests/resolve.cu')
| -rw-r--r-- | tests/resolve.cu | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/tests/resolve.cu b/tests/resolve.cu index abe9fe5..aee8bc4 100644 --- a/tests/resolve.cu +++ b/tests/resolve.cu @@ -1,10 +1,35 @@ typedef A {} +struct generic (T1 A, T2 A) { + a T1; + b T2; +} + +struct other_generic(T1 A) { + a T1; + b T1; +} + /* wow this works pretty good */ -some_func(c A, d typeof c, e i64){c;} -some_func(c A, d typeof c, e typeof d){d;} -some_func(c A, d typeof c, e A){e;} +//some_func(a A, b typeof a, c i64){1;} +//some_func(a A, b typeof a, c typeof b){2;} +//some_func(a A, b typeof a, c A){3;} +//some_func(a generic(u32, u32)) {5;} +//some_func(a other_generic){6;} +// TODO: partial templates shouldn't be allowed +//some_func(a generic(u32)){6;} +//some_func(a generic) {4;} +// illegal +// TODO: traits shouldn't be allowed in template instantiation +//some_func(a generic(A, A)){6;} +//some_func(generic(generic, generic)){1;} +some_func(generic(generic, i64)){2;} +some_func(generic(i64, generic)){3;} +//some_func(generic(i64, i64)){4;} +some_func(generic){5;} main(){ - some_func(20 as f32, 20 as f32, 20 as f64); + // TODO: not fully qualified types in bodies should cause an error + a generic(i64, u32); + some_func(a); } |
