mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Allow $typeof to return a compile time type.
This commit is contained in:
23
test/test_suite/compile_time/untyped_list_type.c3t
Normal file
23
test/test_suite/compile_time/untyped_list_type.c3t
Normal file
@@ -0,0 +1,23 @@
|
||||
// #target: macos-x64
|
||||
module test;
|
||||
|
||||
fn void main()
|
||||
{
|
||||
$switch $typeof({1, "hts"}):
|
||||
$case String:
|
||||
int x = 100;
|
||||
$case $typeof({1, "kdejf"}):
|
||||
int z = 2;
|
||||
$default:
|
||||
int y;
|
||||
$endswitch
|
||||
}
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
define void @test.main() #0 {
|
||||
entry:
|
||||
%z = alloca i32, align 4
|
||||
store i32 2, ptr %z, align 4
|
||||
ret void
|
||||
}
|
||||
Reference in New Issue
Block a user