Files
mgmt/lang/interpret_test/TestAstFunc2/fortytwoerror.txtar
James Shubin d7ecc72b41 lang: ast, gapi, interfaces, parser: Print line numbers on error
This adds an initial implementation of printing line numbers on type
unification errors. It also attempts to print a visual position
indicator for most scenarios.

This patch was started by Felix Frank and finished by James Shubin.

Co-authored-by: Felix Frank <Felix.Frank.de@gmail.com>
2025-02-25 20:15:02 -05:00

19 lines
309 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: type error: int != float: /main.mcl @ 10:6-10:22