XSharpPublic icon indicating copy to clipboard operation
XSharpPublic copied to clipboard

ARRAY OF <type> missing compile time checks

Open cpyrgas opened this issue 1 year ago • 0 comments

I am not sure if this is supposed to be supported or not, please ignore if not:

FUNCTION Start() AS VOID
LOCAL a AS ARRAY of INT
a := ArrayCreate(10) // System.NullReferenceException, shouldn't that create an appropriate array instance?
a := {1,2,3,"A", {1,2}} // XSharp.Error: Value does not fall within the expected range. Shouldn't it be a compiler error?
a[2] := "A" // compiler error cannot convert string to int, OK!
? a[2]

cpyrgas avatar Sep 06 '24 19:09 cpyrgas