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

@@ -671,6 +671,11 @@ type GeneratorInvariant struct {
// from the list. If we error, it's because we don't have any new
// information to provide at this time...
Func func(invariants []Invariant, solved map[Expr]*types.Type) ([]Invariant, error)
// Inactive specifies that we tried to run this, but it didn't help us
// progress forwards. It can be reset if needed. It should only be set
// or read by the solver itself.
Inactive bool
}
// String returns a representation of this invariant.