lang: unification, interfaces: Don't pass over generators

We were skipping over being fully consistent with all of the generator
invariants when running the solver. This allowed us to miss some of the
conditions that a generator might impose. Usually this caused us to be
"solved" when in fact we had an invalid program.
This commit is contained in:
James Shubin
2023-08-29 19:19:26 -04:00
parent 2214954c51
commit 318f28affd
4 changed files with 73 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
-- main.mcl --
import "fmt"
# This should not unify, we need at least one arg.
# NOTE: We have historically needed to turn on the recursive solver to find that
# this was a bug!
test fmt.printf() {}
-- OUTPUT --
# err: errUnify: 2 unconsumed generators

View File

@@ -2,4 +2,4 @@
import "fmt"
test fmt.printf("%d%d", 42) {} # should not pass, missing second int
-- OUTPUT --
# err: errUnify: only recursive solutions left
# err: errUnify: 2 unconsumed generators