-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lang: ast: Expr Param and Poly should not have values
Sometimes a recursive call through ExprVar's Value method would hit one of these and return (nil, nil) which would throw off things.
- Loading branch information
1 parent
6a6546d
commit c333cb5
Showing
2 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
lang/interpret_test/TestAstFunc2/scope-lambda-printf.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- main.mcl -- | ||
import "fmt" | ||
$format = "%d" # should get ignored | ||
$fn = func($format) { | ||
fmt.printf($format, 42) | ||
} | ||
test $fn("%s") {} | ||
# should error at unification if possible, otherwise at runtime | ||
# TODO: I would expect that if the "%s" and "%d" swapped, that speculatively we | ||
# would be able to run this at compile time and know the result statically. | ||
-- OUTPUT -- | ||
# err: errStream: func `printf@??????????` stopped before it was loaded: base kind does not match (Str != Int) |