瀏覽代碼

Allow static arrays of Structs.

Brucey 2 年之前
父節點
當前提交
300c6fa5ff
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      decl.bmx

+ 3 - 2
decl.bmx

@@ -750,8 +750,9 @@ Type TArgDecl Extends TLocalDecl
 				Err "Expecting array"
 			End If
 			
-			If Not TNumericType(TArrayType(ty).elemType) Then
-				Err "Static array elements must be numeric"
+			Local et:TType = TArrayType(ty).elemType
+			If Not TNumericType(et) And Not (TObjectType(et) And TObjectType(et).classDecl.IsStruct()) Then
+				Err "Static array elements must be numeric or a Struct"
 			End If
 		End If