We have an application ported from VO that heavily relies on macro execution, and we discovered the following behaviour in the macro engine when evaluating expressions:
Code: Select all
local xMonth as usual
xMonth := MExec(MCompile("Month(Today())"))
// Result: xMonth contains Long (Int32)
xMonth := MExec(MCompile("Month(Today()) + 1"))
// Result: xMonth contains Int64, UsualType(xMonth) is 22!
// General examples
UsualType(MExec(MCompile("3 + 1"))) // Int32
UsualType(MExec(MCompile("3u + 1u"))) // still Int32
UsualType(MExec(MCompile("3u + 1"))) // Int64 !!
Is this a bug, or is it done on purpose to prevent overflows? Note that the X# compiler itself does NOT do this, it only happens when executing a macro. We are on X# version 2.21.

