You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import "math";
import "console";
var x float = 1.0;
var cosX float = 2 + math.cos(x) + 1;
console.println(cosX);
in this code we call the math.Cos inside a binary expression
this result in the error :
Fatal Error Line: 5, Col: 37
cannot use math here
this is caused by the binary expression not parsing when encountering the selector expression and continuing to parse a selector instead of the correct binary expression
The text was updated successfully, but these errors were encountered:
the error also occurs when we access a field inside a binary expression
import "console";
struct Point {
x: float;
y: float;
}
function TestPoint(p: Point) {
var calc float = p.x + p.y;
console.println(calc);
}
var p Point = Point{1.0, 2.0};
TestPoint(p);
it produces the error :
Fatal Error Line: 9, Col: 31
struct cannot have filed of type Point
mkarten
changed the title
Calling a lib function inside a binary expression causses an error
Calling a lib function of accessing field inside a binary expression causses an error
Sep 30, 2024
in this code we call the math.Cos inside a binary expression
this result in the error :
this is caused by the binary expression not parsing when encountering the selector expression and continuing to parse a selector instead of the correct binary expression
The text was updated successfully, but these errors were encountered: