polserver/testsuite/escript/const/const007-call-module-func.src
Eric Swanson d8ad58f64f
Update test suite for new compiler (#299)
* Update test suite:
- run test suite with both OG compiler and new compiler
- run compiler parity test against testsuite/escript
2020-09-11 01:38:39 -07:00

17 lines
508 B
Text

use math;
// This isn't supposed to compile, but it does. It works because the emitted
// code to call a module function (with 0 parameters) is a single instruction.
//
// This is more commonly seen in NPC control scripts, which often do
// something like this:
// const me := self();
//
// The intent is likely brevity and efficiency, but this will result in
// repeated calls to the module function, rather than storage and reuse
// of the result of a single call.
const PI := ConstPI();
print( PI );