mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Allow indexing of constant strings. Fixed reverse indexing of constant initializers.
This commit is contained in:
15
test/unit/regression/subscripting.c3
Normal file
15
test/unit/regression/subscripting.c3
Normal file
@@ -0,0 +1,15 @@
|
||||
module subscripting_tests @test;
|
||||
|
||||
fn void subscript_ct()
|
||||
{
|
||||
$if int.nameof[0] == 'i':
|
||||
assert(true);
|
||||
$else
|
||||
assert(false);
|
||||
$endif
|
||||
$if int.nameof[^1] == 't':
|
||||
assert(true);
|
||||
$else
|
||||
assert(false);
|
||||
$endif
|
||||
}
|
||||
Reference in New Issue
Block a user