mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
12 lines
191 B
Plaintext
12 lines
191 B
Plaintext
module test @test;
|
|
|
|
fn void const_ternary()
|
|
{
|
|
int foo = 1;
|
|
const int FOO = 1;
|
|
assert((foo ?: 2) == 1);
|
|
assert((FOO ?: 2) == 1);
|
|
int bar = 2;
|
|
assert((FOO ?: bar) == 1);
|
|
}
|