Maybe this is a Feature Request, but I hoped the compiler would tell me I passed the wrong datatype to a Procedure before running the code.
ASM produces runtime IMA which can be helpful to find problem.
CBE just quits: "The debugged executable quit unexpectedly." Now you are forced to find the C output error log?
Code: Select all
EnableExplicit
Structure structI
a.i
b.i
EndStructure
Structure structStr
a$
b$
EndStructure
Procedure.i DoStr(*p.structStr)
ProcedureReturn Val(*p\b$) ;<-- IMA
EndProcedure
Procedure.i DoI(*p.structI)
ProcedureReturn *p\b
EndProcedure
Global.i y
Global xstr.structStr
xStr\b$ = "xStr"
Global xi.structI
xI\b = 2
y = DoI(xStr) ;<-- Compiler accepts wrong datatype for parameter.
Debug y
y = DoStr(xI) ;<-- Compiler accepts wrong datatype for parameter.
;<-- And generates a run-time IMA.
Debug y
; [14:17:52] Waiting for executable to start...
; [14:17:52] Executable type: Windows - x64 (64bit, Unicode, Thread, Purifier)
; [14:17:52] Executable started.
; [14:17:52] [ERROR] BUG_v6_compiler-not-catch-bad-proc(ptr.wrongtype).pb (Line: 11)
; [14:17:52] [ERROR] Invalid memory access. (read error at address 2)
; [14:17:57] The Program was killed.