Closed GWRon closed 3 years ago
StaticArray
as a parameter doesn't seem to be working right either.
This does not compile:
Struct STest
Field StaticArray a:Byte[8]
End Struct
Function Get:STest(StaticArray x:Byte[8])
Local s:STest = New STest
s.a = x
End Function
But this does:
Struct STest
Field a:Byte[8]
End Struct
Function Get:STest(StaticArray x:Byte[8])
Local s:STest = New STest
s.a = x
End Function
On a related note, the StaticArray
syntax is quite weird.
When declaring an identifier, despite being part of the type, the keyword StaticArray
keyword goes in front of the identifier. This makes it unlike anything else in BlitzMax and splits the type in two halves.
So what would be the syntax for writing a StaticArray type without declaring an identifier (for example: function return type, generic type parameter)?
Personally, I'd have preferred syntax like Field a:Byte[Const 8]
for it - which wouldn't have this problem (and not have required a new keyword either).
Thanks
How to return the static array? How do I need to format it to define a function param to be of "StaticArray int[]" ?