Files
c3c/test/test_suite/generic/generic_inference.c3t
Christoffer Lerno 92aefb15f8 Generic inference (#2475)
* Change generic symbol resolution.
* Infer generic parameters lhs -> rhs: `List{int} x = list::NOHEAP`.
* Regression: Compiler segfault when assigning struct literal with too few members #2483
2025-09-16 18:05:21 +02:00

24 lines
388 B
Plaintext

module test;
import std, libc, test2;
fn void hello(Foo{int} x) {}
fn void main()
{
List{int} l = list::ONHEAP;
Maybe{int} m = maybe::value(3);
List{int} y = (List){};
Quaternion z = quaternion::IDENTITY;
z = z * quaternion::IDENTITY;
hello(test2::get_foo());
hello((Foo){});
hello(test2::get_foo{int}());
}
module test2 {Type};
fn Foo get_foo() => {};
struct Foo
{
Type t;
}