drop the generics scaffolding from infer, and test what semen uses

Schemes, instances, rigid variables and defaulting were built ahead of
generics and called by the tests alone, which reached into the IR for
them. The suite now goes through what infer exports, the eleven names
semen imports; what a wildcard solves is checked from source as well.
This commit is contained in:
2026-10-20 12:00:17 +03:00
parent bf8ba2f9fd
commit bc4f9246c2
3 changed files with 41 additions and 355 deletions

View File

@@ -564,6 +564,19 @@
"struct p* x = &s"))
(test-assert "a wildcard inside an array"
(emits? (in-fn "(var t [_ 3] #([int 3] : 1 2 3))") "int t[3]"))
;; each `_' is its own variable: solving one leaves the rest open
(test-assert "every wildcard in a signature is its own"
(emits? "(fn g ((x int)) char (return 0))
(fn f () void (var h (fn ((_)) _) g))"
"char (*h)(int) = g"))
(test-assert "and the signature's arity has to match"
(reports? "(fn g ((x int) (y int)) int (return 0))
(fn f () void (var h (fn ((_)) _) g))"
"type mismatch"))
(test-assert "a typedef answers as itself"
(emits? "(typedef count int) (fn g () count (return 0))
(fn f () void (var x _ (g)))"
"count x = g()"))
;; a compound literal carries its own type, where a brace
;; initializer has none and takes one from its context
(test-assert "a compound literal answers a bare wildcard"