mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix issue with zero arg @operator(construct). Assert on add to uninitialized ct variable #1765
This commit is contained in:
6
test/test_suite/compile_time/add_to_ct_undefined.c3
Normal file
6
test/test_suite/compile_time/add_to_ct_undefined.c3
Normal file
@@ -0,0 +1,6 @@
|
||||
fn int main()
|
||||
{
|
||||
var $a;
|
||||
$a += 1; // #error: not yet initialized
|
||||
return 0;
|
||||
}
|
||||
5
test/test_suite/overloading/construct_op_zero_args.c3
Normal file
5
test/test_suite/overloading/construct_op_zero_args.c3
Normal file
@@ -0,0 +1,5 @@
|
||||
struct Foo { int a; }
|
||||
fn Foo Foo.foo() @operator(construct)
|
||||
{
|
||||
return { 1 };
|
||||
}
|
||||
Reference in New Issue
Block a user