mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
* 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
24 lines
388 B
Plaintext
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;
|
|
} |