mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Subscripting of constant slices would sometimes be considered non-constant #2635.
This commit is contained in:
24
test/test_suite/struct/struct_slice_access.c3t
Normal file
24
test/test_suite/struct/struct_slice_access.c3t
Normal file
@@ -0,0 +1,24 @@
|
||||
module test;
|
||||
import std;
|
||||
|
||||
struct OfStruct
|
||||
{
|
||||
int type;
|
||||
}
|
||||
|
||||
struct IContainAnArrayOfStructs
|
||||
{
|
||||
OfStruct[] array;
|
||||
}
|
||||
|
||||
macro reproduce(OfStruct[] $self)
|
||||
{
|
||||
var a = $self;
|
||||
var b = $self[0];
|
||||
}
|
||||
|
||||
fn int main(String[] args)
|
||||
{
|
||||
reproduce({{1},{2},{3}});
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user