Files
mgmt/lang/interpret_test/TestAstFunc2/fortytwoerror.txtar
James Shubin e10e92596f lang: types: Add stringer information manually
This lets us get the more correct lowercase versions of type kinds in
error messages. (These match what the user would type.)
2024-07-01 18:35:20 -04:00

19 lines
346 B
Plaintext

-- main.mcl --
import "fmt"
import "math"
# This should fail since it can't be polymorphic!
$myfortytwo = func() {
math.fortytwo()
}
$a = $myfortytwo() + 4
$b = $myfortytwo() + 3.0
test ["x",] {
int8 => $a,
float32 => $b,
}
-- OUTPUT --
# err: errUnify: unify error with: topLevel(func() { <built-in:_operator> }): type error: int != float