mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- @if now does implicit conversion to bool like $if. #2086
This commit is contained in:
11
test/test_suite/compile_time/ct_if_bool_conversion_2086.c3
Normal file
11
test/test_suite/compile_time/ct_if_bool_conversion_2086.c3
Normal file
@@ -0,0 +1,11 @@
|
||||
module test;
|
||||
|
||||
fn void main()
|
||||
{
|
||||
int $a = 0;
|
||||
$if $a:
|
||||
$endif;
|
||||
int a @if(!$a);
|
||||
int a @if($a);
|
||||
int a @if((bool)$a);
|
||||
}
|
||||
Reference in New Issue
Block a user