lang: funcs: Hint the struct_lookup functions better

If we have static information, use it to help unification.
This commit is contained in:
James Shubin
2024-08-21 19:00:51 -04:00
parent 82cac572ca
commit 8594b6e2a9
3 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
-- main.mcl --
import "fmt"
$st = struct{
field1 => "value1",
field2 => "value2",
}
class test_struct_lookup($v1, $v2) {
test "test-${v1}-${v2}" {}
}
include test_struct_lookup($st->field1, $st->field2)
-- OUTPUT --
Vertex: test[test-value1-value2]