TypeError: Cannot read property 'invoke' of undefined
hearot opened this issue · 2 comments
hearot commented
I was trying to code my own max
function in Bosque when I got this: TypeError: Cannot read property 'invoke' of undefined
.
I'm using Windows 10 and I used node bin\test\app_runner.js over.bsq
to launch the script.
Output
Reading app code...
Executing app code...
fail with exception -- TypeError: Cannot read property 'invoke' of undefined
Code - over.bsq
namespace NSMain;
function max(x: Int, y: Int): Int
ensures _return_ == x || _return_ == y;
{
if (x >= y) {
return x;
} else {
return y;
}
}
function main(): Int {
var x = 10;
var y = 20;
return max(x, y);
}
mrkmarron commented
The entrypoint
function main should be annotated as such. After the changes below it runs and produces the output 20
.
entrypoint function main(): Int {
var x = 10;
var y = 20;
return max(x, y);
}
hearot commented
Fixed, thank you.