engine, lang: Allow resources with a field of type interface

This lets us add a resource that has an implementation with a field
whose type is determined at compile time. This let's us write more
flexible resources.

What's missing is additional type checking so that we guarantee that a
specific resource doesn't change types during run-time.
This commit is contained in:
James Shubin
2023-11-12 16:16:47 -05:00
parent 9a1a81925e
commit b048b2684b
7 changed files with 62 additions and 1 deletions

View File

@@ -942,6 +942,11 @@ func TestAstFunc2(t *testing.T) {
t.Errorf("test #%d: unification passed, expected fail", index)
return
}
// XXX: Should we do a kind of SetType on resources here
// to tell the ones with variant fields what their
// concrete field types are? They should only be dynamic
// in implementation and before unification, and static
// once we've unified the specific resource.
// build the function graph
graph, err := iast.Graph()