-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Describe the bug
The following code
@[CConst (binding = "MAX_FROM_C", header = "strb.h")]
extern const MAX: nat8
@[EntryPoint]
activity Main () ()
var arr: [MAX]nat8
await true
end
leads to this compile error:
~/git/str-test$ blechc bug.blc
error: The expression MAX must be a compile-time constant.
--> bug.blc:6:15 [typing]
Means the external C constant cannot be used for declaring the array size in Blech.
Expected behaviour
I would expect that above approach works since MAX actually is a compile-time constant.
Or is this a deliberate restriction since Blech cannot verify that MAX is actually constant at compile time?
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels