lang/interpret_test/TestAstFunc2/fortytwoerror.txtar
raw| 1 | -- main.mcl -- |
| 2 | import "fmt" |
| 3 | import "math" |
| 4 | |
| 5 | # This should fail since it can't be polymorphic! |
| 6 | $myfortytwo = func() { |
| 7 | math.fortytwo() |
| 8 | } |
| 9 | |
| 10 | $a = $myfortytwo() + 4 |
| 11 | $b = $myfortytwo() + 3.0 |
| 12 | |
| 13 | test ["x",] { |
| 14 | int8 => $a, |
| 15 | float32 => $b, |
| 16 | } |
| 17 | -- OUTPUT -- |
| 18 | # err: errUnify: unify error with: topLevel(func() { <built-in:_operator> }): type error: int != float |