Files
c3c/test/unit/regression/any.c3
Christoffer Lerno 705856d51a - Disallow casting a void* to any or an interface, unless it is null.
- Defer resolution of declarations when looked up in `def` aliased #1559.
2024-10-16 12:50:47 +02:00

25 lines
270 B
Plaintext

module any_tests @test;
fn void any_compare()
{
int x;
any a = &x;
any b = &x;
assert(a == b);
assert(a == a);
}
def AnyAlias = any;
fn void test_aliasing()
{
int x;
AnyAlias z = &x;
switch (z)
{
case int:
assert(true);
default:
assert(false);
}
}