on master help sign in
Infer simple self-recursive gates
7e69436iko
docs/compiler.md+1−1
@@ -56,7 +56,7 @@ The core is split into chapters, `+| %name`, in this order:
56| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
56| `%span-check` | `+check-spans`, which `+golden` runs on every tree, and `+check-spans-test` |
57| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
57| `%type-inference` | The initial inference fragment and its unification helpers; not yet a module type checker |
58
58
59−The inference fragment supports fixed auras, unrestricted `@`, one-way widening into it and toward aura-family ancestors, generic variables and gates, faced and unfaced cells, cell sample binders, known record field reads, a two-binder cell pattern, a complete two-arm loobean branch, a complete two-arm unit-shaped branch, closed local mold aliases and acyclic forward value references. It instantiates generalized top-level definitions when they are used. Acyclic local value definitions can refer forward and generalize variables that are free of their enclosing environment; captured variables and explicit capitals remain shared. Acyclic simple local mold aliases can also refer forward, and are scoped to the body, not its gate's sample. Nonrecursive generic aliases of supported molds can be applied at exact arity, including locally and through library interfaces; their parameters are lexical. Closed, provably disjoint nonrecursive unions and tagged single-case molds support contextual term values, `~` and `|=%tag` constructors. A null-headed cell can match a union case but does not supply a `|=%$` constructor; unresolved tags and nulls remain pending, with distinct partial-inference diagnostics. Nonrecursive top-level generic union molds with provably disjoint cases also support contextual tags and constructors at exact arity; their arguments are retained through generalization and supported library interfaces. Nonrecursive generic aliases can reorder, repeat or omit parameters while preserving a supported union’s origin, including through local scopes and library interfaces. A generic union declared directly inside a body remains unsupported, as do recursive local groups and recursive molds. A value with type variable `A` can fit a field whose type is that same `A`, including in generic union payloads and nested or repeated record fields. A differing-variable face constraint remains unsupported. It can infer and generalize atom constraints arising from explicit capitals or bare sample binders, preserve those constraints through aliases, instantiate them independently, and print multiple constraints. Unresolved decimal variables default to `@ud` for inferred types without gates; defaulting inside gate types and other constraint cases remain incomplete. It does not yet check a module, complete imports, general patterns, general deferred constraints, recursive molds, dependency cycles or most errors with both conflicting excerpts. Definite cast and call mismatches, incompatible branches and overlapping union cases report both sites and excerpts. Concrete branch results can join at an explicitly present parent aura or `@`. Some known tuple and record positions acquire matching faces; other variable-dependent face merges, general branch tag context and ambiguous call-result propagation remain unsupported; function compatibility involving nested `@` and variable-dependent joins remain unsupported except for equal types. The current dependency pass can take quadratic time on long forward chains; the milestone's speed target remains unverified. A separate conservative pass reports unions whose cases are provably disjoint or overlapping and leaves other cases unresolved; it does not claim the mold is checked. Unsupported forms are reported as such, and the partial output says the module has not been checked.
59+The inference fragment supports fixed auras, unrestricted `@`, one-way widening into it and toward aura-family ancestors, generic variables and gates, faced and unfaced cells, cell sample binders, known record field reads, a two-binder cell pattern, a complete two-arm loobean branch, a complete two-arm unit-shaped branch, closed local mold aliases and acyclic forward value references. A supported single syntactic top-level gate can refer to itself through one monomorphic placeholder; the completed body must unify with it before the gate is generalized. Uses of generalized top-level definitions instantiate their schemes independently. Mutual groups, local recursive gates, polymorphic recursion and value cycles remain unsupported. Acyclic local value definitions can refer forward and generalize variables that are free of their enclosing environment; captured variables and explicit capitals remain shared. Acyclic simple local mold aliases can also refer forward, and are scoped to the body, not its gate's sample. Nonrecursive generic aliases of supported molds can be applied at exact arity, including locally and through library interfaces; their parameters are lexical. Closed, provably disjoint nonrecursive unions and tagged single-case molds support contextual term values, `~` and `|=%tag` constructors. A null-headed cell can match a union case but does not supply a `|=%$` constructor; unresolved tags and nulls remain pending, with distinct partial-inference diagnostics. Nonrecursive top-level generic union molds with provably disjoint cases also support contextual tags and constructors at exact arity; their arguments are retained through generalization and supported library interfaces. Nonrecursive generic aliases can reorder, repeat or omit parameters while preserving a supported union’s origin, including through local scopes and library interfaces. A generic union declared directly inside a body remains unsupported, as do recursive local groups and recursive molds. A value with type variable `A` can fit a field whose type is that same `A`, including in generic union payloads and nested or repeated record fields. A differing-variable face constraint remains unsupported. It can infer and generalize atom constraints arising from explicit capitals or bare sample binders, preserve those constraints through aliases, instantiate them independently, and print multiple constraints. Unresolved decimal variables default to `@ud` for inferred types without gates; defaulting inside gate types and other constraint cases remain incomplete. It does not yet check a module, complete imports, general patterns, general deferred constraints, recursive molds, dependency cycles or most errors with both conflicting excerpts. Definite cast and call mismatches, incompatible branches and overlapping union cases report both sites and excerpts. Concrete branch results can join at an explicitly present parent aura or `@`. Some known tuple and record positions acquire matching faces; other variable-dependent face merges, general branch tag context and ambiguous call-result propagation remain unsupported; function compatibility involving nested `@` and variable-dependent joins remain unsupported except for equal types. The reporting path repeats inference of a recursive gate rather than instantiating its generalized interface inside its own body. This adds work, and the current dependency pass can take quadratic time on long forward chains; the milestone's speed target remains unverified. A separate conservative pass reports unions whose cases are provably disjoint or overlapping and leaves other cases unresolved; it does not claim the mold is checked. Unsupported forms are reported as such, and the partial output says the module has not been checked.
60
60
61For supported closed unions, the type printer keeps the union’s origin separate from its displayed name. It prints an in-scope name such as `msg` or `msg.lib`, including in records and gates; an accessible imported nongeneric alias may name a transitive union. A nongeneric body-local union that escapes its scope, or an origin without an accessible name, prints its cases separated by spaces, parenthesized when nested. That case-list form is print-only. A supported generic union prints its name and all arguments, including unused arguments; when its name is unavailable, the partial printer reports that limitation instead of dropping its arguments. Two faces for the same imported origin remain compatible; compatibility between distinct union origins, including in gate types, remains unsupported. Some comparisons of generic union arguments also remain unsupported rather than deciding equality or mismatch. The Hoon bridge also translates some imported unnamed unions into this representation; unsupported cases remain errors.
61For supported closed unions, the type printer keeps the union’s origin separate from its displayed name. It prints an in-scope name such as `msg` or `msg.lib`, including in records and gates; an accessible imported nongeneric alias may name a transitive union. A nongeneric body-local union that escapes its scope, or an origin without an accessible name, prints its cases separated by spaces, parenthesized when nested. That case-list form is print-only. A supported generic union prints its name and all arguments, including unused arguments; when its name is unavailable, the partial printer reports that limitation instead of dropping its arguments. Two faces for the same imported origin remain compatible; compatibility between distinct union origins, including in gate types, remains unsupported. Some comparisons of generic union arguments also remain unsupported rather than deciding equality or mismatch. The Hoon bridge also translates some imported unnamed unions into this representation; unsupported cases remain errors.
62
62
docs/status.md+7−6
@@ -19,7 +19,7 @@ On 2026-10-30, @iko decided that Jibb drops `$?`, so a `+$` takes a union's case
19
19
20## Milestone 2: in progress
20## Milestone 2: in progress
21
21
22−The repository spec records the subsequent type-system and prelude decisions; those changes also need synchronization to the Claude document. An initial inference fragment and a standalone Hoon type reader are being tested. The fragment explicitly reports that it does not check a module; partial bridges pass selected Hoon atoms, term singletons, nested faced or unfaced cells, supported disjoint unions and opaque standard collections from `/sur` molds and marks into inference. Collections retain their names and supported arguments for printing and unification; nested supported union arguments are retained too. The bridge trusts unchanged results from the source-aware reader; a materialized type graph alone cannot reveal cases Hoon already collapsed. The source-validated standard prelude `list` mold shares this representation with imported lists; other Jibb-written collection molds and prelude collection operations are not yet connected; malformed names and arities fail closed. Selected self-recursive `/sur` molds cross as opaque module-and-name identities; aliases, foreign references, recursive marks, unfolding and construction remain unsupported. The reader handles mark samples, recursive molds whose origins can be verified through Ford imports, nested collections, direct ordered maps, certain ordered-map fields, direct `$^` unions whose cases can be proved disjoint, and one verified explicit union argument in a list, set, map or unit. Ambiguous recursive origins fail closed; recognizable explicit unions are checked from source before Hoon can collapse their cases (doc question 22), while other nested unions, nested ordered maps, general union disjointness and complete import integration remain unfinished. The partial checker resolves a subset of ordinary library imports in dependency order using supplied Jibb sources and a source-derived partial prelude interface, caches completed interfaces per run, and detects missing sources and cycles. It does not yet check API or kind semantics, and the prelude inventory is incomplete. The inference fragment supports unrestricted `@`, selected one-way widenings including aura-family ancestors, generalized atom constraints arising from explicit capitals or bare sample binders, acyclic local value definitions with captures, simple and nonrecursive generic mold aliases, selected faced record casts and field reads, and contextual tags, `~` and constructors for closed disjoint unions, including direct nonrecursive generic unions and propagation through complete loobean and unit-shaped branches in casts and known union-sample calls, including nested branches. Contextual null-headed cells fit their cases, but do not supply a `|=%$` constructor; unresolved nulls remain pending and are reported separately from tags. A known union of `~` and a null-headed cell supports a complete `~` / `[~ value]` branch in either order, including shadow checks; unknown subjects, missing or duplicate arms, and unresolved branch results remain unsupported. This fragment infers the prelude’s `fall` and `need` signatures. With the validated prelude list and a known cast or gate sample, empty, nonempty and nested list literals infer their element types, including contextual union tags; a mismatched element names both sites. In that context `~` and zero-valued terms fit an empty list, and two-item unfaced cells form cons lists, including nested cons and imported-list contexts; invalid heads or tails name both sites. Faced or longer cells and a missing or altered prelude list fail closed. For a known standard list with a supported element type, a complete `~` / `[item rest]` branch infers the element and tail types in either arm order and checks binders for shadowing. Uncontextualized list construction, unknown subjects, unsupported element types and other or incomplete list patterns remain unsupported. A value with type variable `A` can fit a field whose type is that same `A`, including in generic union payloads and nested or repeated record fields. Other variable-dependent face merges remain unsupported. Supported closed unions print using an in-scope name or imported alias; an unnamed nongeneric union prints its cases, parenthesized when nested. The latter is print-only. Generic union types retain all arguments in their printed name; if that name is unavailable, the partial printer reports the limitation. Different import faces for the same origin remain compatible; compatibility across distinct union origins and some generic-argument comparisons remain unsupported. Nonrecursive generic aliases can reorder, repeat or omit parameters while retaining a union’s origin, including through local scopes and library interfaces. A generic union declared directly inside a body remains unsupported, as do differing-variable face constraints in a union payload. A transitive generic union whose name is unavailable is reported as unsupported instead of hiding its arguments. Unfixed decimal literals default to `@ud` in gate-free inferred types; recursive local groups and molds, general branch tag context, other constraint cases and defaulting inside gate types still need work. Collection recognition checks the originating core and fails closed on shadows or unsupported Ford subject shapes; a wrapper regression also rejects forged subjects, samples and tails. Its golden fixtures include three real Tlon files. A Clay test passes a Ford-built nested union through the reader into partial inference. The partial prelude includes `murn`, `join`, `snip` and `rear`, parsed but still awaiting checker and backend validation, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
22+The repository spec records the subsequent type-system and prelude decisions; those changes also need synchronization to the Claude document. An initial inference fragment and a standalone Hoon type reader are being tested. The fragment explicitly reports that it does not check a module; partial bridges pass selected Hoon atoms, term singletons, nested faced or unfaced cells, supported disjoint unions and opaque standard collections from `/sur` molds and marks into inference. Collections retain their names and supported arguments for printing and unification; nested supported union arguments are retained too. The bridge trusts unchanged results from the source-aware reader; a materialized type graph alone cannot reveal cases Hoon already collapsed. The source-validated standard prelude `list` mold shares this representation with imported lists; other Jibb-written collection molds and prelude collection operations are not yet connected; malformed names and arities fail closed. Selected self-recursive `/sur` molds cross as opaque module-and-name identities; aliases, foreign references, recursive marks, unfolding and construction remain unsupported. The reader handles mark samples, recursive molds whose origins can be verified through Ford imports, nested collections, direct ordered maps, certain ordered-map fields, direct `$^` unions whose cases can be proved disjoint, and one verified explicit union argument in a list, set, map or unit. Ambiguous recursive origins fail closed; recognizable explicit unions are checked from source before Hoon can collapse their cases (doc question 22), while other nested unions, nested ordered maps, general union disjointness and complete import integration remain unfinished. The partial checker resolves a subset of ordinary library imports in dependency order using supplied Jibb sources and a source-derived partial prelude interface, caches completed interfaces per run, and detects missing sources and cycles. It does not yet check API or kind semantics, and the prelude inventory is incomplete. The inference fragment supports unrestricted `@`, selected one-way widenings including aura-family ancestors, generalized atom constraints arising from explicit capitals or bare sample binders, acyclic local value definitions with captures, selected single self-recursive top-level gates, simple and nonrecursive generic mold aliases, selected faced record casts and field reads, and contextual tags, `~` and constructors for closed disjoint unions, including direct nonrecursive generic unions and propagation through complete loobean and unit-shaped branches in casts and known union-sample calls, including nested branches. A recursive gate uses one monomorphic self reference while its body is inferred, then generalizes after the body is checked; subsequent uses instantiate it independently. Mutual groups, local recursive gates, polymorphic recursion and value cycles remain unsupported. Reporting repeats inference for a recursive gate, so its performance cost remains unmeasured. Contextual null-headed cells fit their cases, but do not supply a `|=%$` constructor; unresolved nulls remain pending and are reported separately from tags. A known union of `~` and a null-headed cell supports a complete `~` / `[~ value]` branch in either order, including shadow checks; unknown subjects, missing or duplicate arms, and unresolved branch results remain unsupported. This fragment infers the prelude’s `fall` and `need` signatures. With the validated prelude list and a known cast or gate sample, empty, nonempty and nested list literals infer their element types, including contextual union tags; a mismatched element names both sites. In that context `~` and zero-valued terms fit an empty list, and two-item unfaced cells form cons lists, including nested cons and imported-list contexts; invalid heads or tails name both sites. Faced or longer cells and a missing or altered prelude list fail closed. For a known standard list with a supported element type, a complete `~` / `[item rest]` branch infers the element and tail types in either arm order and checks binders for shadowing. Uncontextualized list construction, unknown subjects, unsupported element types and other or incomplete list patterns remain unsupported. A value with type variable `A` can fit a field whose type is that same `A`, including in generic union payloads and nested or repeated record fields. Other variable-dependent face merges remain unsupported. Supported closed unions print using an in-scope name or imported alias; an unnamed nongeneric union prints its cases, parenthesized when nested. The latter is print-only. Generic union types retain all arguments in their printed name; if that name is unavailable, the partial printer reports the limitation. Different import faces for the same origin remain compatible; compatibility across distinct union origins and some generic-argument comparisons remain unsupported. Nonrecursive generic aliases can reorder, repeat or omit parameters while retaining a union’s origin, including through local scopes and library interfaces. A generic union declared directly inside a body remains unsupported, as do differing-variable face constraints in a union payload. A transitive generic union whose name is unavailable is reported as unsupported instead of hiding its arguments. Unfixed decimal literals default to `@ud` in gate-free inferred types; recursive local groups and molds, general branch tag context, other constraint cases and defaulting inside gate types still need work. Collection recognition checks the originating core and fails closed on shadows or unsupported Ford subject shapes; a wrapper regression also rejects forged subjects, samples and tails. Its golden fixtures include three real Tlon files. A Clay test passes a Ford-built nested union through the reader into partial inference. The partial prelude includes `murn`, `join`, `snip` and `rear`, parsed but still awaiting checker and backend validation, and [prelude-inventory.md](prelude-inventory.md) is a source audit, not the complete inventory or signatures. The milestone remains unfinished.
23
23
24The shared prelude interface reserves every name present in the supplied vendored source and makes only supported inferred entries available, including `list`, `unit`, `same`, `fall` and `need`. Unsupported entries such as most list helpers remain reserved but unavailable. All callers use the same prelude origin, so a library can export a type containing unqualified `(unit A)` to another module. Preparation rejects empty, malformed, conflicting or import-bearing source; the prepared value is trusted and must come unchanged from `+prepare-prelude`. The module-scope fixture compares the prepared and source-taking paths against the real prelude and a two-module golden under eval and on the ship. The source and checker remain incomplete, so this does not establish complete shadowing coverage or a checked module.
24The shared prelude interface reserves every name present in the supplied vendored source and makes only supported inferred entries available, including `list`, `unit`, `same`, `fall` and `need`. Unsupported entries such as most list helpers remain reserved but unavailable. All callers use the same prelude origin, so a library can export a type containing unqualified `(unit A)` to another module. Preparation rejects empty, malformed, conflicting or import-bearing source; the prepared value is trusted and must come unchanged from `+prepare-prelude`. The module-scope fixture compares the prepared and source-taking paths against the real prelude and a two-module golden under eval and on the ship. The source and checker remain incomplete, so this does not establish complete shadowing coverage or a checked module.
25
25
@@ -39,8 +39,8 @@ What the plan asks for, and where it is:
39
39
40Besides the plan's list:
40Besides the plan's list:
41
41
42−- 502 golden cases: 286 that parse and 216 that fail, each failure at a stated line and column. One failing case has an unclear expectation (corpus question 3). The newer type-output cases exercise only the partial inference fragment. Each case's `about.txt` quotes the doc's words it tests.
42+- 503 golden cases: 287 that parse and 216 that fail, each failure at a stated line and column. One failing case has an unclear expectation (corpus question 3). The newer type-output cases exercise only the partial inference fragment. Each case's `about.txt` quotes the doc's words it tests.
43−- The 502-case corpus passed under `urbit eval` in 56.5 s. The fake ship passed all 507 tests, including the importer, importer/checker and mark/checker bridges, module scope and unification checks, with 28.9 s for sync and 33.9 s for tests. The importer golden compares 141 projections; `tools/clay-fixtures` builds the example Hoon fixtures through Clay, checks a recursive Ford import's origin, and passes Clay-built types through the Clay-built importer and partial checker.
43+- The 503-case corpus passed under `urbit eval` in 59.6 s. The fake ship passed all 508 tests, including the importer, importer/checker and mark/checker bridges, module scope and unification checks, with 28.1 s for sync and 32.1 s for tests. The importer golden compares 141 projections; `tools/clay-fixtures` builds the example Hoon fixtures through Clay, checks a recursive Ford import's origin, and passes Clay-built types through the Clay-built importer and partial checker.
44- `tools/testdata/selftest` (22 checks) and `tools/testdata/ship-selftest` test the tools themselves.
44- `tools/testdata/selftest` (22 checks) and `tools/testdata/ship-selftest` test the tools themselves.
45- Two independent audits before 7c739b7, one of which compared the library with a reference parser written in Python from the doc over about 19,000 generated programs. Before ab797a9, a second Python parser, written from the decisions, agreed with the library on 8,000 generated programs and 900 hand-written probes.
45- Two independent audits before 7c739b7, one of which compared the library with a reference parser written in Python from the doc over about 19,000 generated programs. Before ab797a9, a second Python parser, written from the decisions, agreed with the library on 8,000 generated programs and 900 hand-written probes.
46- Speed: starting `urbit eval` and building the library takes about 8 s. After that, a 2,000-line module of 400 definitions parses in about a second. Loops over definitions, arms, lines and items grow no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (library section 3).
46- Speed: starting `urbit eval` and building the library takes about 8 s. After that, a 2,000-line module of 400 definitions parses in about a second. Loops over definitions, arms, lines and items grow no stack; nesting costs a few stack frames a level, and 100,000 nested brackets still parse (library section 3).
@@ -82,14 +82,15 @@ Besides the plan's list:
82| 3f90fa8 | 2026-10-30 | Share a partial prelude interface across module inference |
82| 3f90fa8 | 2026-10-30 | Share a partial prelude interface across module inference |
83| 29bd39f | 2026-10-30 | Infer contextual list literals and validate prelude parity |
83| 29bd39f | 2026-10-30 | Infer contextual list literals and validate prelude parity |
84| a2a6ef5 | 2026-10-30 | Infer complete list-shaped branches |
84| a2a6ef5 | 2026-10-30 | Infer complete list-shaped branches |
85−| This change | 2026-10-30 | Infer contextual list nulls and cons cells |
85+| 671fe72 | 2026-10-30 | Infer contextual list nulls and cons cells |
86+| This change | 2026-10-30 | Infer selected self-recursive gates |
86
87
87## Checking it
88## Checking it
88
89
89On a machine set up as [development.md](development.md) says:
90On a machine set up as [development.md](development.md) says:
90
91
91```
92```
92−tools/golden # 502 cases under urbit eval
93+tools/golden # 503 cases under urbit eval
93tools/importer-test # the Hoon importer fixture projection
94tools/importer-test # the Hoon importer fixture projection
94tools/type-import-test # the importer/checker bridge fixture
95tools/type-import-test # the importer/checker bridge fixture
95tools/type-mark-test # the mark/checker bridge fixture
96tools/type-mark-test # the mark/checker bridge fixture
@@ -99,7 +100,7 @@ tools/testdata/selftest # the tools themselves
99tools/doc-blocks docs/spec # the doc's examples are golden cases
100tools/doc-blocks docs/spec # the doc's examples are golden cases
100tools/ship start
101tools/ship start
101tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
102tools/ship gen-tests --check # tests/lib/jibb.hoon is up to date
102−tools/ship test # the same 502 cases as -test arms on the ship
103+tools/ship test # the same 503 cases as -test arms on the ship
103tools/testdata/ship-selftest
104tools/testdata/ship-selftest
104tools/ship check-commit # |commit stores .jibb files
105tools/ship check-commit # |commit stores .jibb files
105tools/clay-fixtures # example /sur files and marks build through Clay
106tools/clay-fixtures # example /sur files and marks build through Clay
jibb-dev/lib/jibb.hoon+29−4
@@ -6781,8 +6781,8 @@
6781::
6781::
6782:: Build the supported part of the value environment in dependency order.
6782:: Build the supported part of the value environment in dependency order.
6783:: Each pass adds successful definitions. Forward references become
6783:: Each pass adds successful definitions. Forward references become
6784−:: available on a later pass; recursive groups and unsupported syntax do
6784+:: available on a later pass; mutually recursive groups and unsupported
6785−:: not enter the environment. Generalized definitions are closed, so a
6785+:: syntax do not enter the environment. Generalized definitions are closed, so a
6786:: use instantiates its variables afresh.
6786:: use instantiates its variables afresh.
6787::
6787::
6788++ global-value-names
6788++ global-value-names
@@ -6801,6 +6801,25 @@
6801 ?~ t.hits &
6801 ?~ t.hits &
6802 |
6802 |
6803::
6803::
6804+:: A top-level gate may refer to itself through one monomorphic placeholder.
6805+:: Unify the completed body with that placeholder before generalization;
6806+:: reporting repeats the same check instead of instantiating the gate's
6807+:: generalized interface inside its own body. Mutual groups stay unsupported.
6808+::
6809+++ infer-recursive-gate
6810+ |= [d=def env=ienv state=istate]
6811+ ^- iresult
6812+ ?. ?=(%value -.d) [%| ["recursive definition is not a gate" ~]]
6813+ ?. |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
6814+ [%| ["recursive definition is not a gate" ~]]
6815+ =/ id=@ud next.state
6816+ =/ seeded=ienv [[name.d [[%var id] ~]] env]
6817+ =/ out=iresult (infer-fragment val.d seeded state(next +(id)))
6818+ ?: ?=(%| -.out) out
6819+ =/ uni=(unit isub) (itype-unify [%var id] typ.p.out sub.state.p.out)
6820+ ?~ uni [%| ["recursive gate constraint is not supported by partial inference" ~]]
6821+ [%& typ.p.out state.p.out(sub u.uni)]
6822+::
6804++ add-supported-defs
6823++ add-supported-defs
6805 |= [ds=(list def) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile)]
6824 |= [ds=(list def) env=ienv molds=imolds globals=(list term) externals=iexternals surs=(list term) mark-externals=imark-externals marks=(list term) jimports=ijimports reserved-molds=(list term) at=path prelude=(unit ifile)]
6806 ^- ienv
6825 ^- ienv
@@ -6810,7 +6829,9 @@
6810 ?. (unique-value-name name.d globals) $(ds t.ds)
6829 ?. (unique-value-name name.d globals) $(ds t.ds)
6811 ?^ (ienv-lookup name.d env) $(ds t.ds)
6830 ?^ (ienv-lookup name.d env) $(ds t.ds)
6812 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
6831 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
6813− =/ result=iresult (infer-fragment val.d env [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude])
6832+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | at top prelude]
6833+ =/ result=iresult (infer-fragment val.d env initial)
6834+ =? result ?=(%| -.result) (infer-recursive-gate d env initial)
6814 ?: ?=(%| -.result) $(ds t.ds)
6835 ?: ?=(%| -.result) $(ds t.ds)
6815 ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
6836 ?: (constrained-capitals caps.state.p.result sub.state.p.result) $(ds t.ds)
6816 =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
6837 =/ typ=itype (default-decimals (itype-normalize typ.p.result sub.state.p.result))
@@ -7298,7 +7319,11 @@
7298 ?. (unique-value-name name.d globals)
7319 ?. (unique-value-name name.d globals)
7299 $(ds t.ds, lines [(crip "++ {(trip name.d)}: name already in scope") lines])
7320 $(ds t.ds, lines [(crip "++ {(trip name.d)}: name already in scope") lines])
7300 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
7321 =/ top=(list term) (turn molds |=(m=[name=term body=shape] name.m))
7301− =/ result=iresult (infer-fragment val.d env [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude])
7322+ =/ initial=istate [0 ~ ~ ~ molds globals externals surs mark-externals marks jimports reserved-molds ~ ~ ~ | file top prelude]
7323+ =/ result=iresult
7324+ ?: |(?=(%gate -.val.d) ?=(%gate-wide -.val.d))
7325+ (infer-recursive-gate d env initial)
7326+ (infer-fragment val.d env initial)
7302 ?: ?=(%| -.result)
7327 ?: ?=(%| -.result)
7303 $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
7328 $(ds t.ds, lines [(show-inference-diagnostic file src name.d p.result) lines])
7304 ?: (constrained-capitals caps.state.p.result sub.state.p.result)
7329 ?: (constrained-capitals caps.state.p.result sub.state.p.result)
tests/golden/types-recursive-gate/about.txtnew file+4
@@ -0,0 +1,4 @@
1+source: Grammar, Modules: "Gates may call themselves and their siblings; other values can't depend on themselves, even through a gate"; Molds: "Type variables are capitals, generalized per `++`."
2+tests: A single recursive gate is inferred monomorphically during its body and generalized afterward. Value cycles, mutual recursion, changing recursive argument types, occurs checks and unresolved constraints fail closed.
3+expect: parses
4+expect-types: a partial inference report
tests/golden/types-recursive-gate/source.jibbnew file+55
@@ -0,0 +1,55 @@
1+++ bounce |= b=?
2+ ?- b
3+ %.y %.n
4+ %.n (bounce %.y)
5+++ recur |= x=A
6+ ?- %.y
7+ %.y x
8+ %.n (recur x)
9+++ cord-result (recur "hi")
10+++ ship-result (recur ~zod)
11+++ poly |= x=A (poly [x x])
12+++ occurs |= x (x x)
13+++ forcing |= x=A
14+ ?- %.y
15+ %.y ^- @t x
16+ %.n (forcing x)
17+++ pending |= b=?
18+ ?- b
19+ %.y %unknown
20+ %.n (pending b)
21+++ direct-value direct-value
22+++ gate-value |= x=A value-cycle
23+++ value-cycle gate-value
24+++ mutual-a |= x=A (mutual-b x)
25+++ mutual-b |= x=A (mutual-a x)
26+++ captured |= x=A
27+ ++ use |= b=?
28+ ?- b
29+ %.y x
30+ %.n (captured x)
31+ (use %.y)
32+++ local-rec |= x=A
33+ ++ inner |= y=A (inner y)
34+ (inner x)
35+++ forced-trace |= x=A
36+ ~& ^- @t x
37+ (forced-trace x)
38+++ pending-trace |= x=A
39+ ~& %orphan
40+ (pending-trace x)
41+++ higher |= f=$-(A A)
42+ |= x=A
43+ ?- %.y
44+ %.y (f x)
45+ %.n ((higher f) x)
46+++ local-self |= x=A
47+ ++ call |= y=A (local-self y)
48+ (call x)
49+++ mixed |= x=A
50+ ++ alias mixed
51+ ~& (alias "hi")
52+ (alias ~zod)
53+++ return-self |= x=A return-self
54+++ value-a value-b
55+++ value-b value-a
tests/golden/types-recursive-gate/tokens.txtnew file+355
@@ -0,0 +1,355 @@
1+1:1 glyph ++
2+1:4 name bounce
3+1:11 glyph |=
4+1:14 name b
5+1:15 tight glyph =
6+1:16 tight glyph ?
7+2:3 INDENT
8+2:3 glyph ?-
9+2:6 name b
10+3:5 INDENT
11+3:5 lit %.y
12+3:9 lit %.n
13+4:5 NEWLINE
14+4:5 lit %.n
15+4:9 glyph (
16+4:10 tight name bounce
17+4:17 lit %.y
18+4:20 tight glyph )
19+5:1 DEDENT
20+5:1 DEDENT
21+5:1 NEWLINE
22+5:1 glyph ++
23+5:4 name recur
24+5:10 glyph |=
25+5:13 name x
26+5:14 tight glyph =
27+5:15 tight tvar A
28+6:3 INDENT
29+6:3 glyph ?-
30+6:6 lit %.y
31+7:5 INDENT
32+7:5 lit %.y
33+7:9 name x
34+8:5 NEWLINE
35+8:5 lit %.n
36+8:9 glyph (
37+8:10 tight name recur
38+8:16 name x
39+8:17 tight glyph )
40+9:1 DEDENT
41+9:1 DEDENT
42+9:1 NEWLINE
43+9:1 glyph ++
44+9:4 name cord-result
45+9:16 glyph (
46+9:17 tight name recur
47+9:23 str "hi"
48+9:27 tight glyph )
49+10:1 NEWLINE
50+10:1 glyph ++
51+10:4 name ship-result
52+10:16 glyph (
53+10:17 tight name recur
54+10:23 lit ~zod
55+10:27 tight glyph )
56+11:1 NEWLINE
57+11:1 glyph ++
58+11:4 name poly
59+11:9 glyph |=
60+11:12 name x
61+11:13 tight glyph =
62+11:14 tight tvar A
63+11:16 glyph (
64+11:17 tight name poly
65+11:22 glyph [
66+11:23 tight name x
67+11:25 name x
68+11:26 tight glyph ]
69+11:27 tight glyph )
70+12:1 NEWLINE
71+12:1 glyph ++
72+12:4 name occurs
73+12:11 glyph |=
74+12:14 name x
75+12:16 glyph (
76+12:17 tight name x
77+12:19 name x
78+12:20 tight glyph )
79+13:1 NEWLINE
80+13:1 glyph ++
81+13:4 name forcing
82+13:12 glyph |=
83+13:15 name x
84+13:16 tight glyph =
85+13:17 tight tvar A
86+14:3 INDENT
87+14:3 glyph ?-
88+14:6 lit %.y
89+15:5 INDENT
90+15:5 lit %.y
91+15:9 glyph ^-
92+15:12 aura @t
93+15:15 name x
94+16:5 NEWLINE
95+16:5 lit %.n
96+16:9 glyph (
97+16:10 tight name forcing
98+16:18 name x
99+16:19 tight glyph )
100+17:1 DEDENT
101+17:1 DEDENT
102+17:1 NEWLINE
103+17:1 glyph ++
104+17:4 name pending
105+17:12 glyph |=
106+17:15 name b
107+17:16 tight glyph =
108+17:17 tight glyph ?
109+18:3 INDENT
110+18:3 glyph ?-
111+18:6 name b
112+19:5 INDENT
113+19:5 lit %.y
114+19:9 lit %unknown
115+20:5 NEWLINE
116+20:5 lit %.n
117+20:9 glyph (
118+20:10 tight name pending
119+20:18 name b
120+20:19 tight glyph )
121+21:1 DEDENT
122+21:1 DEDENT
123+21:1 NEWLINE
124+21:1 glyph ++
125+21:4 name direct-value
126+21:17 name direct-value
127+22:1 NEWLINE
128+22:1 glyph ++
129+22:4 name gate-value
130+22:15 glyph |=
131+22:18 name x
132+22:19 tight glyph =
133+22:20 tight tvar A
134+22:22 name value-cycle
135+23:1 NEWLINE
136+23:1 glyph ++
137+23:4 name value-cycle
138+23:16 name gate-value
139+24:1 NEWLINE
140+24:1 glyph ++
141+24:4 name mutual-a
142+24:13 glyph |=
143+24:16 name x
144+24:17 tight glyph =
145+24:18 tight tvar A
146+24:20 glyph (
147+24:21 tight name mutual-b
148+24:30 name x
149+24:31 tight glyph )
150+25:1 NEWLINE
151+25:1 glyph ++
152+25:4 name mutual-b
153+25:13 glyph |=
154+25:16 name x
155+25:17 tight glyph =
156+25:18 tight tvar A
157+25:20 glyph (
158+25:21 tight name mutual-a
159+25:30 name x
160+25:31 tight glyph )
161+26:1 NEWLINE
162+26:1 glyph ++
163+26:4 name captured
164+26:13 glyph |=
165+26:16 name x
166+26:17 tight glyph =
167+26:18 tight tvar A
168+27:3 INDENT
169+27:3 glyph ++
170+27:6 name use
171+27:10 glyph |=
172+27:13 name b
173+27:14 tight glyph =
174+27:15 tight glyph ?
175+28:5 INDENT
176+28:5 glyph ?-
177+28:8 name b
178+29:7 INDENT
179+29:7 lit %.y
180+29:11 name x
181+30:7 NEWLINE
182+30:7 lit %.n
183+30:11 glyph (
184+30:12 tight name captured
185+30:21 name x
186+30:22 tight glyph )
187+31:3 DEDENT
188+31:3 DEDENT
189+31:3 NEWLINE
190+31:3 glyph (
191+31:4 tight name use
192+31:8 lit %.y
193+31:11 tight glyph )
194+32:1 DEDENT
195+32:1 NEWLINE
196+32:1 glyph ++
197+32:4 name local-rec
198+32:14 glyph |=
199+32:17 name x
200+32:18 tight glyph =
201+32:19 tight tvar A
202+33:3 INDENT
203+33:3 glyph ++
204+33:6 name inner
205+33:12 glyph |=
206+33:15 name y
207+33:16 tight glyph =
208+33:17 tight tvar A
209+33:19 glyph (
210+33:20 tight name inner
211+33:26 name y
212+33:27 tight glyph )
213+34:3 NEWLINE
214+34:3 glyph (
215+34:4 tight name inner
216+34:10 name x
217+34:11 tight glyph )
218+35:1 DEDENT
219+35:1 NEWLINE
220+35:1 glyph ++
221+35:4 name forced-trace
222+35:17 glyph |=
223+35:20 name x
224+35:21 tight glyph =
225+35:22 tight tvar A
226+36:3 INDENT
227+36:3 glyph ~&
228+36:6 glyph ^-
229+36:9 aura @t
230+36:12 name x
231+37:5 INDENT
232+37:5 glyph (
233+37:6 tight name forced-trace
234+37:19 name x
235+37:20 tight glyph )
236+38:1 DEDENT
237+38:1 DEDENT
238+38:1 NEWLINE
239+38:1 glyph ++
240+38:4 name pending-trace
241+38:18 glyph |=
242+38:21 name x
243+38:22 tight glyph =
244+38:23 tight tvar A
245+39:3 INDENT
246+39:3 glyph ~&
247+39:6 lit %orphan
248+40:5 INDENT
249+40:5 glyph (
250+40:6 tight name pending-trace
251+40:20 name x
252+40:21 tight glyph )
253+41:1 DEDENT
254+41:1 DEDENT
255+41:1 NEWLINE
256+41:1 glyph ++
257+41:4 name higher
258+41:11 glyph |=
259+41:14 name f
260+41:15 tight glyph =
261+41:16 tight glyph $-(
262+41:19 tight tvar A
263+41:21 tvar A
264+41:22 tight glyph )
265+42:3 INDENT
266+42:3 glyph |=
267+42:6 name x
268+42:7 tight glyph =
269+42:8 tight tvar A
270+43:5 INDENT
271+43:5 glyph ?-
272+43:8 lit %.y
273+44:7 INDENT
274+44:7 lit %.y
275+44:11 glyph (
276+44:12 tight name f
277+44:14 name x
278+44:15 tight glyph )
279+45:7 NEWLINE
280+45:7 lit %.n
281+45:11 glyph (
282+45:12 tight glyph (
283+45:13 tight name higher
284+45:20 name f
285+45:21 tight glyph )
286+45:23 name x
287+45:24 tight glyph )
288+46:1 DEDENT
289+46:1 DEDENT
290+46:1 DEDENT
291+46:1 NEWLINE
292+46:1 glyph ++
293+46:4 name local-self
294+46:15 glyph |=
295+46:18 name x
296+46:19 tight glyph =
297+46:20 tight tvar A
298+47:3 INDENT
299+47:3 glyph ++
300+47:6 name call
301+47:11 glyph |=
302+47:14 name y
303+47:15 tight glyph =
304+47:16 tight tvar A
305+47:18 glyph (
306+47:19 tight name local-self
307+47:30 name y
308+47:31 tight glyph )
309+48:3 NEWLINE
310+48:3 glyph (
311+48:4 tight name call
312+48:9 name x
313+48:10 tight glyph )
314+49:1 DEDENT
315+49:1 NEWLINE
316+49:1 glyph ++
317+49:4 name mixed
318+49:10 glyph |=
319+49:13 name x
320+49:14 tight glyph =
321+49:15 tight tvar A
322+50:3 INDENT
323+50:3 glyph ++
324+50:6 name alias
325+50:12 name mixed
326+51:3 NEWLINE
327+51:3 glyph ~&
328+51:6 glyph (
329+51:7 tight name alias
330+51:13 str "hi"
331+51:17 tight glyph )
332+52:5 INDENT
333+52:5 glyph (
334+52:6 tight name alias
335+52:12 lit ~zod
336+52:16 tight glyph )
337+53:1 DEDENT
338+53:1 DEDENT
339+53:1 NEWLINE
340+53:1 glyph ++
341+53:4 name return-self
342+53:16 glyph |=
343+53:19 name x
344+53:20 tight glyph =
345+53:21 tight tvar A
346+53:23 name return-self
347+54:1 NEWLINE
348+54:1 glyph ++
349+54:4 name value-a
350+54:12 name value-b
351+55:1 NEWLINE
352+55:1 glyph ++
353+55:4 name value-b
354+55:12 name value-a
355+55:19 NEWLINE
tests/golden/types-recursive-gate/tree.txtnew file+176
@@ -0,0 +1,176 @@
1+(module
2+ (value 1:1 bounce
3+ (gate 1:11
4+ (face 1:14 b (flag 1:16))
5+ (body 2:3
6+ (branch 2:3
7+ (wing 2:6 b)
8+ (arm 3:5 (lit 3:5 %.y) (lit 3:9 %.n))
9+ (arm 4:5
10+ (lit 4:5 %.n)
11+ (group 4:9
12+ (call 4:10 (wing 4:10 bounce) (lit 4:17 %.y))))))))
13+ (value 5:1 recur
14+ (gate 5:10
15+ (face 5:13 x (tvar 5:15 A))
16+ (body 6:3
17+ (branch 6:3
18+ (lit 6:6 %.y)
19+ (arm 7:5 (lit 7:5 %.y) (wing 7:9 x))
20+ (arm 8:5
21+ (lit 8:5 %.n)
22+ (group 8:9
23+ (call 8:10 (wing 8:10 recur) (wing 8:16 x))))))))
24+ (value 9:1 cord-result
25+ (group 9:16
26+ (call 9:17 (wing 9:17 recur) (str 9:23 "hi"))))
27+ (value 10:1 ship-result
28+ (group 10:16
29+ (call 10:17 (wing 10:17 recur) (lit 10:23 ~zod))))
30+ (value 11:1 poly
31+ (gate 11:9
32+ (face 11:12 x (tvar 11:14 A))
33+ (group 11:16
34+ (call 11:17
35+ (wing 11:17 poly)
36+ (tuple 11:22 (wing 11:23 x) (wing 11:25 x))))))
37+ (value 12:1 occurs
38+ (gate 12:11
39+ (bind 12:14 x)
40+ (group 12:16
41+ (call 12:17 (wing 12:17 x) (wing 12:19 x)))))
42+ (value 13:1 forcing
43+ (gate 13:12
44+ (face 13:15 x (tvar 13:17 A))
45+ (body 14:3
46+ (branch 14:3
47+ (lit 14:6 %.y)
48+ (arm 15:5
49+ (lit 15:5 %.y)
50+ (cast 15:9 (aura 15:12 @t) (wing 15:15 x)))
51+ (arm 16:5
52+ (lit 16:5 %.n)
53+ (group 16:9
54+ (call 16:10 (wing 16:10 forcing) (wing 16:18 x))))))))
55+ (value 17:1 pending
56+ (gate 17:12
57+ (face 17:15 b (flag 17:17))
58+ (body 18:3
59+ (branch 18:3
60+ (wing 18:6 b)
61+ (arm 19:5 (lit 19:5 %.y) (lit 19:9 %unknown))
62+ (arm 20:5
63+ (lit 20:5 %.n)
64+ (group 20:9
65+ (call 20:10 (wing 20:10 pending) (wing 20:18 b))))))))
66+ (value 21:1 direct-value (wing 21:17 direct-value))
67+ (value 22:1 gate-value
68+ (gate 22:15
69+ (face 22:18 x (tvar 22:20 A))
70+ (wing 22:22 value-cycle)))
71+ (value 23:1 value-cycle (wing 23:16 gate-value))
72+ (value 24:1 mutual-a
73+ (gate 24:13
74+ (face 24:16 x (tvar 24:18 A))
75+ (group 24:20
76+ (call 24:21 (wing 24:21 mutual-b) (wing 24:30 x)))))
77+ (value 25:1 mutual-b
78+ (gate 25:13
79+ (face 25:16 x (tvar 25:18 A))
80+ (group 25:20
81+ (call 25:21 (wing 25:21 mutual-a) (wing 25:30 x)))))
82+ (value 26:1 captured
83+ (gate 26:13
84+ (face 26:16 x (tvar 26:18 A))
85+ (body 27:3
86+ (value 27:3 use
87+ (gate 27:10
88+ (face 27:13 b (flag 27:15))
89+ (body 28:5
90+ (branch 28:5
91+ (wing 28:8 b)
92+ (arm 29:7 (lit 29:7 %.y) (wing 29:11 x))
93+ (arm 30:7
94+ (lit 30:7 %.n)
95+ (group 30:11
96+ (call 30:12 (wing 30:12 captured) (wing 30:21 x))))))))
97+ (group 31:3
98+ (call 31:4 (wing 31:4 use) (lit 31:8 %.y))))))
99+ (value 32:1 local-rec
100+ (gate 32:14
101+ (face 32:17 x (tvar 32:19 A))
102+ (body 33:3
103+ (value 33:3 inner
104+ (gate 33:12
105+ (face 33:15 y (tvar 33:17 A))
106+ (group 33:19
107+ (call 33:20 (wing 33:20 inner) (wing 33:26 y)))))
108+ (group 34:3
109+ (call 34:4 (wing 34:4 inner) (wing 34:10 x))))))
110+ (value 35:1 forced-trace
111+ (gate 35:17
112+ (face 35:20 x (tvar 35:22 A))
113+ (body 36:3
114+ (trace 36:3
115+ (cast 36:6 (aura 36:9 @t) (wing 36:12 x))
116+ (body 37:5
117+ (group 37:5
118+ (call 37:6 (wing 37:6 forced-trace) (wing 37:19 x))))))))
119+ (value 38:1 pending-trace
120+ (gate 38:18
121+ (face 38:21 x (tvar 38:23 A))
122+ (body 39:3
123+ (trace 39:3
124+ (lit 39:6 %orphan)
125+ (body 40:5
126+ (group 40:5
127+ (call 40:6 (wing 40:6 pending-trace) (wing 40:20 x))))))))
128+ (value 41:1 higher
129+ (gate 41:11
130+ (face 41:14 f
131+ (fn 41:16 (tvar 41:19 A) (tvar 41:21 A)))
132+ (body 42:3
133+ (gate 42:3
134+ (face 42:6 x (tvar 42:8 A))
135+ (body 43:5
136+ (branch 43:5
137+ (lit 43:8 %.y)
138+ (arm 44:7
139+ (lit 44:7 %.y)
140+ (group 44:11
141+ (call 44:12 (wing 44:12 f) (wing 44:14 x))))
142+ (arm 45:7
143+ (lit 45:7 %.n)
144+ (group 45:11
145+ (call 45:12
146+ (group 45:12
147+ (call 45:13 (wing 45:13 higher) (wing 45:20 f)))
148+ (wing 45:23 x))))))))))
149+ (value 46:1 local-self
150+ (gate 46:15
151+ (face 46:18 x (tvar 46:20 A))
152+ (body 47:3
153+ (value 47:3 call
154+ (gate 47:11
155+ (face 47:14 y (tvar 47:16 A))
156+ (group 47:18
157+ (call 47:19 (wing 47:19 local-self) (wing 47:30 y)))))
158+ (group 48:3
159+ (call 48:4 (wing 48:4 call) (wing 48:9 x))))))
160+ (value 49:1 mixed
161+ (gate 49:10
162+ (face 49:13 x (tvar 49:15 A))
163+ (body 50:3
164+ (value 50:3 alias (wing 50:12 mixed))
165+ (trace 51:3
166+ (group 51:6
167+ (call 51:7 (wing 51:7 alias) (str 51:13 "hi")))
168+ (body 52:5
169+ (group 52:5
170+ (call 52:6 (wing 52:6 alias) (lit 52:12 ~zod))))))))
171+ (value 53:1 return-self
172+ (gate 53:16
173+ (face 53:19 x (tvar 53:21 A))
174+ (wing 53:23 return-self)))
175+ (value 54:1 value-a (wing 54:12 value-b))
176+ (value 55:1 value-b (wing 55:12 value-a)))
tests/golden/types-recursive-gate/types.txtnew file+36
@@ -0,0 +1,36 @@
1+partial inference; module not checked
2+++ bounce: branch widening is not supported by partial inference
3+++ recur: $-(A A)
4+++ cord-result: @t
5+++ ship-result: @p
6+++ poly: recursive gate constraint is not supported by partial inference
7+++ occurs: call's sample and argument types do not unify
8+/tests/golden/types-recursive-gate/source.jibb:12:17: called gate
9+++ occurs |= x (x x)
10+ ^
11+/tests/golden/types-recursive-gate/source.jibb:12:19: argument
12+++ occurs |= x (x x)
13+ ^
14+++ forcing: branch widening is not supported by partial inference
15+++ pending: branch widening is not supported by partial inference
16+++ direct-value: name is not available to partial inference
17+++ gate-value: name is not available to partial inference
18+++ value-cycle: name is not available to partial inference
19+++ mutual-a: name is not available to partial inference
20+++ mutual-b: name is not available to partial inference
21+++ captured: $-(A A)
22+++ local-rec: local definitions need unsupported inference
23+++ forced-trace: explicit capital constraints are not supported by partial inference
24+++ pending-trace: tag needs context in partial inference
25+++ higher: $-($-(A A) $-(A A))
26+++ local-self: $-(A B)
27+++ mixed: call's sample and argument types do not unify
28+/tests/golden/types-recursive-gate/source.jibb:52:6: called gate has type $-(@t A)
29+ (alias ~zod)
30+ ^
31+/tests/golden/types-recursive-gate/source.jibb:52:12: argument has type @p
32+ (alias ~zod)
33+ ^
34+++ return-self: recursive gate constraint is not supported by partial inference
35+++ value-a: name is not available to partial inference
36+++ value-b: name is not available to partial inference
tests/lib/jibb.hoon+139−133
@@ -1656,115 +1656,119 @@
1656/* tok-478 %txt /tests/golden/types-record-to-tuple/tokens/txt
1656/* tok-478 %txt /tests/golden/types-record-to-tuple/tokens/txt
1657/* tre-478 %txt /tests/golden/types-record-to-tuple/tree/txt
1657/* tre-478 %txt /tests/golden/types-record-to-tuple/tree/txt
1658/* typ-478 %txt /tests/golden/types-record-to-tuple/types/txt
1658/* typ-478 %txt /tests/golden/types-record-to-tuple/types/txt
1659−/* src-479 %jibb /tests/golden/types-union-alias/source/jibb
1659+/* src-479 %jibb /tests/golden/types-recursive-gate/source/jibb
1660+/* tok-479 %txt /tests/golden/types-recursive-gate/tokens/txt
1661+/* tre-479 %txt /tests/golden/types-recursive-gate/tree/txt
1662+/* typ-479 %txt /tests/golden/types-recursive-gate/types/txt
1663+/* src-480 %jibb /tests/golden/types-union-alias/source/jibb
1660−/* tok-479 %txt /tests/golden/types-union-alias/tokens/txt
1664+/* tok-480 %txt /tests/golden/types-union-alias/tokens/txt
1661−/* tre-479 %txt /tests/golden/types-union-alias/tree/txt
1665+/* tre-480 %txt /tests/golden/types-union-alias/tree/txt
1662−/* typ-479 %txt /tests/golden/types-union-alias/types/txt
1666+/* typ-480 %txt /tests/golden/types-union-alias/types/txt
1663−/* src-480 %jibb /tests/golden/types-union-branch-context/source/jibb
1667+/* src-481 %jibb /tests/golden/types-union-branch-context/source/jibb
1664−/* tok-480 %txt /tests/golden/types-union-branch-context/tokens/txt
1668+/* tok-481 %txt /tests/golden/types-union-branch-context/tokens/txt
1665−/* tre-480 %txt /tests/golden/types-union-branch-context/tree/txt
1669+/* tre-481 %txt /tests/golden/types-union-branch-context/tree/txt
1666−/* typ-480 %txt /tests/golden/types-union-branch-context/types/txt
1670+/* typ-481 %txt /tests/golden/types-union-branch-context/types/txt
1667−/* src-481 %jibb /tests/golden/types-union-branch-pending/source/jibb
1671+/* src-482 %jibb /tests/golden/types-union-branch-pending/source/jibb
1668−/* tok-481 %txt /tests/golden/types-union-branch-pending/tokens/txt
1672+/* tok-482 %txt /tests/golden/types-union-branch-pending/tokens/txt
1669−/* tre-481 %txt /tests/golden/types-union-branch-pending/tree/txt
1673+/* tre-482 %txt /tests/golden/types-union-branch-pending/tree/txt
1670−/* typ-481 %txt /tests/golden/types-union-branch-pending/types/txt
1674+/* typ-482 %txt /tests/golden/types-union-branch-pending/types/txt
1671−/* src-482 %jibb /tests/golden/types-union-constructor-shape/source/jibb
1675+/* src-483 %jibb /tests/golden/types-union-constructor-shape/source/jibb
1672−/* tok-482 %txt /tests/golden/types-union-constructor-shape/tokens/txt
1676+/* tok-483 %txt /tests/golden/types-union-constructor-shape/tokens/txt
1673−/* tre-482 %txt /tests/golden/types-union-constructor-shape/tree/txt
1677+/* tre-483 %txt /tests/golden/types-union-constructor-shape/tree/txt
1674−/* typ-482 %txt /tests/golden/types-union-constructor-shape/types/txt
1678+/* typ-483 %txt /tests/golden/types-union-constructor-shape/types/txt
1675−/* src-483 %jibb /tests/golden/types-union-context-flow/source/jibb
1679+/* src-484 %jibb /tests/golden/types-union-context-flow/source/jibb
1676−/* tok-483 %txt /tests/golden/types-union-context-flow/tokens/txt
1680+/* tok-484 %txt /tests/golden/types-union-context-flow/tokens/txt
1677−/* tre-483 %txt /tests/golden/types-union-context-flow/tree/txt
1681+/* tre-484 %txt /tests/golden/types-union-context-flow/tree/txt
1678−/* typ-483 %txt /tests/golden/types-union-context-flow/types/txt
1682+/* typ-484 %txt /tests/golden/types-union-context-flow/types/txt
1679−/* src-484 %jibb /tests/golden/types-union-import/source/jibb
1683+/* src-485 %jibb /tests/golden/types-union-import/source/jibb
1680−/* tok-484 %txt /tests/golden/types-union-import/tokens/txt
1684+/* tok-485 %txt /tests/golden/types-union-import/tokens/txt
1681−/* tre-484 %txt /tests/golden/types-union-import/tree/txt
1685+/* tre-485 %txt /tests/golden/types-union-import/tree/txt
1682−/* mod-484-1 %jibb /tests/golden/types-union-import/modules/ui/lib/jibb
1686+/* mod-485-1 %jibb /tests/golden/types-union-import/modules/ui/lib/jibb
1683−/* typ-484 %txt /tests/golden/types-union-import/types/txt
1687+/* typ-485 %txt /tests/golden/types-union-import/types/txt
1684−/* mtre-484 %txt /tests/golden/types-union-import/module-trees/txt
1688+/* mtre-485 %txt /tests/golden/types-union-import/module-trees/txt
1685−/* src-485 %jibb /tests/golden/types-union-local-pending/source/jibb
1689+/* src-486 %jibb /tests/golden/types-union-local-pending/source/jibb
1686−/* tok-485 %txt /tests/golden/types-union-local-pending/tokens/txt
1690+/* tok-486 %txt /tests/golden/types-union-local-pending/tokens/txt
1687−/* tre-485 %txt /tests/golden/types-union-local-pending/tree/txt
1691+/* tre-486 %txt /tests/golden/types-union-local-pending/tree/txt
1688−/* typ-485 %txt /tests/golden/types-union-local-pending/types/txt
1692+/* typ-486 %txt /tests/golden/types-union-local-pending/types/txt
1689−/* src-486 %jibb /tests/golden/types-union-overlap/source/jibb
1693+/* src-487 %jibb /tests/golden/types-union-overlap/source/jibb
1690−/* tok-486 %txt /tests/golden/types-union-overlap/tokens/txt
1694+/* tok-487 %txt /tests/golden/types-union-overlap/tokens/txt
1691−/* tre-486 %txt /tests/golden/types-union-overlap/tree/txt
1695+/* tre-487 %txt /tests/golden/types-union-overlap/tree/txt
1692−/* typ-486 %txt /tests/golden/types-union-overlap/types/txt
1696+/* typ-487 %txt /tests/golden/types-union-overlap/types/txt
1693−/* src-487 %jibb /tests/golden/types-union-overlap-nested/source/jibb
1697+/* src-488 %jibb /tests/golden/types-union-overlap-nested/source/jibb
1694−/* tok-487 %txt /tests/golden/types-union-overlap-nested/tokens/txt
1698+/* tok-488 %txt /tests/golden/types-union-overlap-nested/tokens/txt
1695−/* tre-487 %txt /tests/golden/types-union-overlap-nested/tree/txt
1699+/* tre-488 %txt /tests/golden/types-union-overlap-nested/tree/txt
1696−/* typ-487 %txt /tests/golden/types-union-overlap-nested/types/txt
1700+/* typ-488 %txt /tests/golden/types-union-overlap-nested/types/txt
1697−/* src-488 %jibb /tests/golden/types-union-phantom-generic/source/jibb
1701+/* src-489 %jibb /tests/golden/types-union-phantom-generic/source/jibb
1698−/* tok-488 %txt /tests/golden/types-union-phantom-generic/tokens/txt
1702+/* tok-489 %txt /tests/golden/types-union-phantom-generic/tokens/txt
1699−/* tre-488 %txt /tests/golden/types-union-phantom-generic/tree/txt
1703+/* tre-489 %txt /tests/golden/types-union-phantom-generic/tree/txt
1700−/* typ-488 %txt /tests/golden/types-union-phantom-generic/types/txt
1704+/* typ-489 %txt /tests/golden/types-union-phantom-generic/types/txt
1701−/* src-489 %jibb /tests/golden/types-union-print-cross-namespace/source/jibb
1705+/* src-490 %jibb /tests/golden/types-union-print-cross-namespace/source/jibb
1702−/* tok-489 %txt /tests/golden/types-union-print-cross-namespace/tokens/txt
1706+/* tok-490 %txt /tests/golden/types-union-print-cross-namespace/tokens/txt
1703−/* tre-489 %txt /tests/golden/types-union-print-cross-namespace/tree/txt
1707+/* tre-490 %txt /tests/golden/types-union-print-cross-namespace/tree/txt
1704−/* mod-489-1 %jibb /tests/golden/types-union-print-cross-namespace/modules/ui/lib/jibb
1708+/* mod-490-1 %jibb /tests/golden/types-union-print-cross-namespace/modules/ui/lib/jibb
1705−/* typ-489 %txt /tests/golden/types-union-print-cross-namespace/types/txt
1709+/* typ-490 %txt /tests/golden/types-union-print-cross-namespace/types/txt
1706−/* mtre-489 %txt /tests/golden/types-union-print-cross-namespace/module-trees/txt
1710+/* mtre-490 %txt /tests/golden/types-union-print-cross-namespace/module-trees/txt
1707−/* src-490 %jibb /tests/golden/types-union-print-distinct/source/jibb
1711+/* src-491 %jibb /tests/golden/types-union-print-distinct/source/jibb
1708−/* tok-490 %txt /tests/golden/types-union-print-distinct/tokens/txt
1712+/* tok-491 %txt /tests/golden/types-union-print-distinct/tokens/txt
1709−/* tre-490 %txt /tests/golden/types-union-print-distinct/tree/txt
1713+/* tre-491 %txt /tests/golden/types-union-print-distinct/tree/txt
1710−/* mod-490-1 %jibb /tests/golden/types-union-print-distinct/modules/ui/left/jibb
1714+/* mod-491-1 %jibb /tests/golden/types-union-print-distinct/modules/ui/left/jibb
1711−/* mod-490-2 %jibb /tests/golden/types-union-print-distinct/modules/ui/right/jibb
1715+/* mod-491-2 %jibb /tests/golden/types-union-print-distinct/modules/ui/right/jibb
1712−/* mod-490-3 %jibb /tests/golden/types-union-print-distinct/modules/ui/twin/jibb
1716+/* mod-491-3 %jibb /tests/golden/types-union-print-distinct/modules/ui/twin/jibb
1713−/* typ-490 %txt /tests/golden/types-union-print-distinct/types/txt
1717+/* typ-491 %txt /tests/golden/types-union-print-distinct/types/txt
1714−/* mtre-490 %txt /tests/golden/types-union-print-distinct/module-trees/txt
1718+/* mtre-491 %txt /tests/golden/types-union-print-distinct/module-trees/txt
1715−/* src-491 %jibb /tests/golden/types-union-print-escape/source/jibb
1719+/* src-492 %jibb /tests/golden/types-union-print-escape/source/jibb
1716−/* tok-491 %txt /tests/golden/types-union-print-escape/tokens/txt
1720+/* tok-492 %txt /tests/golden/types-union-print-escape/tokens/txt
1717−/* tre-491 %txt /tests/golden/types-union-print-escape/tree/txt
1721+/* tre-492 %txt /tests/golden/types-union-print-escape/tree/txt
1718−/* typ-491 %txt /tests/golden/types-union-print-escape/types/txt
1722+/* typ-492 %txt /tests/golden/types-union-print-escape/types/txt
1719−/* src-492 %jibb /tests/golden/types-union-print-local/source/jibb
1723+/* src-493 %jibb /tests/golden/types-union-print-local/source/jibb
1720−/* tok-492 %txt /tests/golden/types-union-print-local/tokens/txt
1724+/* tok-493 %txt /tests/golden/types-union-print-local/tokens/txt
1721−/* tre-492 %txt /tests/golden/types-union-print-local/tree/txt
1725+/* tre-493 %txt /tests/golden/types-union-print-local/tree/txt
1722−/* typ-492 %txt /tests/golden/types-union-print-local/types/txt
1726+/* typ-493 %txt /tests/golden/types-union-print-local/types/txt
1723−/* src-493 %jibb /tests/golden/types-union-print-nested/source/jibb
1727+/* src-494 %jibb /tests/golden/types-union-print-nested/source/jibb
1724−/* tok-493 %txt /tests/golden/types-union-print-nested/tokens/txt
1728+/* tok-494 %txt /tests/golden/types-union-print-nested/tokens/txt
1725−/* tre-493 %txt /tests/golden/types-union-print-nested/tree/txt
1729+/* tre-494 %txt /tests/golden/types-union-print-nested/tree/txt
1726−/* typ-493 %txt /tests/golden/types-union-print-nested/types/txt
1730+/* typ-494 %txt /tests/golden/types-union-print-nested/types/txt
1727−/* src-494 %jibb /tests/golden/types-union-print-same-origin/source/jibb
1731+/* src-495 %jibb /tests/golden/types-union-print-same-origin/source/jibb
1728−/* tok-494 %txt /tests/golden/types-union-print-same-origin/tokens/txt
1732+/* tok-495 %txt /tests/golden/types-union-print-same-origin/tokens/txt
1729−/* tre-494 %txt /tests/golden/types-union-print-same-origin/tree/txt
1733+/* tre-495 %txt /tests/golden/types-union-print-same-origin/tree/txt
1730−/* mod-494-1 %jibb /tests/golden/types-union-print-same-origin/modules/ui/shared/jibb
1734+/* mod-495-1 %jibb /tests/golden/types-union-print-same-origin/modules/ui/shared/jibb
1731−/* typ-494 %txt /tests/golden/types-union-print-same-origin/types/txt
1735+/* typ-495 %txt /tests/golden/types-union-print-same-origin/types/txt
1732−/* mtre-494 %txt /tests/golden/types-union-print-same-origin/module-trees/txt
1736+/* mtre-495 %txt /tests/golden/types-union-print-same-origin/module-trees/txt
1733−/* src-495 %jibb /tests/golden/types-union-print-transitive/source/jibb
1737+/* src-496 %jibb /tests/golden/types-union-print-transitive/source/jibb
1734−/* tok-495 %txt /tests/golden/types-union-print-transitive/tokens/txt
1738+/* tok-496 %txt /tests/golden/types-union-print-transitive/tokens/txt
1735−/* tre-495 %txt /tests/golden/types-union-print-transitive/tree/txt
1739+/* tre-496 %txt /tests/golden/types-union-print-transitive/tree/txt
1736−/* mod-495-1 %jibb /tests/golden/types-union-print-transitive/modules/ui/mid/jibb
1740+/* mod-496-1 %jibb /tests/golden/types-union-print-transitive/modules/ui/mid/jibb
1737−/* mod-495-2 %jibb /tests/golden/types-union-print-transitive/modules/ui/base/jibb
1741+/* mod-496-2 %jibb /tests/golden/types-union-print-transitive/modules/ui/base/jibb
1738−/* typ-495 %txt /tests/golden/types-union-print-transitive/types/txt
1742+/* typ-496 %txt /tests/golden/types-union-print-transitive/types/txt
1739−/* mtre-495 %txt /tests/golden/types-union-print-transitive/module-trees/txt
1743+/* mtre-496 %txt /tests/golden/types-union-print-transitive/module-trees/txt
1740−/* src-496 %jibb /tests/golden/types-union-singleton/source/jibb
1744+/* src-497 %jibb /tests/golden/types-union-singleton/source/jibb
1741−/* tok-496 %txt /tests/golden/types-union-singleton/tokens/txt
1745+/* tok-497 %txt /tests/golden/types-union-singleton/tokens/txt
1742−/* tre-496 %txt /tests/golden/types-union-singleton/tree/txt
1746+/* tre-497 %txt /tests/golden/types-union-singleton/tree/txt
1743−/* typ-496 %txt /tests/golden/types-union-singleton/types/txt
1747+/* typ-497 %txt /tests/golden/types-union-singleton/types/txt
1744−/* src-497 %jibb /tests/golden/types-union-tag-atoms/source/jibb
1748+/* src-498 %jibb /tests/golden/types-union-tag-atoms/source/jibb
1745−/* tok-497 %txt /tests/golden/types-union-tag-atoms/tokens/txt
1749+/* tok-498 %txt /tests/golden/types-union-tag-atoms/tokens/txt
1746−/* tre-497 %txt /tests/golden/types-union-tag-atoms/tree/txt
1750+/* tre-498 %txt /tests/golden/types-union-tag-atoms/tree/txt
1747−/* typ-497 %txt /tests/golden/types-union-tag-atoms/types/txt
1751+/* typ-498 %txt /tests/golden/types-union-tag-atoms/types/txt
1748−/* src-498 %jibb /tests/golden/types-union-tags/source/jibb
1752+/* src-499 %jibb /tests/golden/types-union-tags/source/jibb
1749−/* tok-498 %txt /tests/golden/types-union-tags/tokens/txt
1753+/* tok-499 %txt /tests/golden/types-union-tags/tokens/txt
1750−/* tre-498 %txt /tests/golden/types-union-tags/tree/txt
1754+/* tre-499 %txt /tests/golden/types-union-tags/tree/txt
1751−/* typ-498 %txt /tests/golden/types-union-tags/types/txt
1755+/* typ-499 %txt /tests/golden/types-union-tags/types/txt
1752−/* src-499 %jibb /tests/golden/types-union-unresolved/source/jibb
1756+/* src-500 %jibb /tests/golden/types-union-unresolved/source/jibb
1753−/* tok-499 %txt /tests/golden/types-union-unresolved/tokens/txt
1757+/* tok-500 %txt /tests/golden/types-union-unresolved/tokens/txt
1754−/* tre-499 %txt /tests/golden/types-union-unresolved/tree/txt
1758+/* tre-500 %txt /tests/golden/types-union-unresolved/tree/txt
1755−/* typ-499 %txt /tests/golden/types-union-unresolved/types/txt
1759+/* typ-500 %txt /tests/golden/types-union-unresolved/types/txt
1756−/* src-500 %jibb /tests/golden/types-union-unresolved-flow/source/jibb
1760+/* src-501 %jibb /tests/golden/types-union-unresolved-flow/source/jibb
1757−/* tok-500 %txt /tests/golden/types-union-unresolved-flow/tokens/txt
1761+/* tok-501 %txt /tests/golden/types-union-unresolved-flow/tokens/txt
1758−/* tre-500 %txt /tests/golden/types-union-unresolved-flow/tree/txt
1762+/* tre-501 %txt /tests/golden/types-union-unresolved-flow/tree/txt
1759−/* typ-500 %txt /tests/golden/types-union-unresolved-flow/types/txt
1763+/* typ-501 %txt /tests/golden/types-union-unresolved-flow/types/txt
1760−/* src-501 %jibb /tests/golden/types-unit-context/source/jibb
1764+/* src-502 %jibb /tests/golden/types-unit-context/source/jibb
1761−/* tok-501 %txt /tests/golden/types-unit-context/tokens/txt
1765+/* tok-502 %txt /tests/golden/types-unit-context/tokens/txt
1762−/* tre-501 %txt /tests/golden/types-unit-context/tree/txt
1766+/* tre-502 %txt /tests/golden/types-unit-context/tree/txt
1763−/* typ-501 %txt /tests/golden/types-unit-context/types/txt
1767+/* typ-502 %txt /tests/golden/types-unit-context/types/txt
1764−/* src-502 %jibb /tests/golden/types-unit-patterns/source/jibb
1768+/* src-503 %jibb /tests/golden/types-unit-patterns/source/jibb
1765−/* tok-502 %txt /tests/golden/types-unit-patterns/tokens/txt
1769+/* tok-503 %txt /tests/golden/types-unit-patterns/tokens/txt
1766−/* tre-502 %txt /tests/golden/types-unit-patterns/tree/txt
1770+/* tre-503 %txt /tests/golden/types-unit-patterns/tree/txt
1767−/* typ-502 %txt /tests/golden/types-unit-patterns/types/txt
1771+/* typ-503 %txt /tests/golden/types-unit-patterns/types/txt
1768=/ prepared-prelude (prepare-prelude:jibb prelude-source)
1772=/ prepared-prelude (prepare-prelude:jibb prelude-source)
1769|%
1773|%
1770:: one arm per case
1774:: one arm per case
@@ -2725,54 +2729,56 @@
2725 (weld (check ~.types-record-nested src-477 `tok-477 `tre-477) (check-types ~.types-record-nested ~[%tests %golden ~.types-record-nested %source %jibb] src-477 `typ-477))
2729 (weld (check ~.types-record-nested src-477 `tok-477 `tre-477) (check-types ~.types-record-nested ~[%tests %golden ~.types-record-nested %source %jibb] src-477 `typ-477))
2726++ test-types-record-to-tuple
2730++ test-types-record-to-tuple
2727 (weld (check ~.types-record-to-tuple src-478 `tok-478 `tre-478) (check-types ~.types-record-to-tuple ~[%tests %golden ~.types-record-to-tuple %source %jibb] src-478 `typ-478))
2731 (weld (check ~.types-record-to-tuple src-478 `tok-478 `tre-478) (check-types ~.types-record-to-tuple ~[%tests %golden ~.types-record-to-tuple %source %jibb] src-478 `typ-478))
2732+++ test-types-recursive-gate
2733+ (weld (check ~.types-recursive-gate src-479 `tok-479 `tre-479) (check-types ~.types-recursive-gate ~[%tests %golden ~.types-recursive-gate %source %jibb] src-479 `typ-479))
2728++ test-types-union-alias
2734++ test-types-union-alias
2729− (weld (check ~.types-union-alias src-479 `tok-479 `tre-479) (check-types ~.types-union-alias ~[%tests %golden ~.types-union-alias %source %jibb] src-479 `typ-479))
2735+ (weld (check ~.types-union-alias src-480 `tok-480 `tre-480) (check-types ~.types-union-alias ~[%tests %golden ~.types-union-alias %source %jibb] src-480 `typ-480))
2730++ test-types-union-branch-context
2736++ test-types-union-branch-context
2731− (weld (check ~.types-union-branch-context src-480 `tok-480 `tre-480) (check-types ~.types-union-branch-context ~[%tests %golden ~.types-union-branch-context %source %jibb] src-480 `typ-480))
2737+ (weld (check ~.types-union-branch-context src-481 `tok-481 `tre-481) (check-types ~.types-union-branch-context ~[%tests %golden ~.types-union-branch-context %source %jibb] src-481 `typ-481))
2732++ test-types-union-branch-pending
2738++ test-types-union-branch-pending
2733− (weld (check ~.types-union-branch-pending src-481 `tok-481 `tre-481) (check-types ~.types-union-branch-pending ~[%tests %golden ~.types-union-branch-pending %source %jibb] src-481 `typ-481))
2739+ (weld (check ~.types-union-branch-pending src-482 `tok-482 `tre-482) (check-types ~.types-union-branch-pending ~[%tests %golden ~.types-union-branch-pending %source %jibb] src-482 `typ-482))
2734++ test-types-union-constructor-shape
2740++ test-types-union-constructor-shape
2735− (weld (check ~.types-union-constructor-shape src-482 `tok-482 `tre-482) (check-types ~.types-union-constructor-shape ~[%tests %golden ~.types-union-constructor-shape %source %jibb] src-482 `typ-482))
2741+ (weld (check ~.types-union-constructor-shape src-483 `tok-483 `tre-483) (check-types ~.types-union-constructor-shape ~[%tests %golden ~.types-union-constructor-shape %source %jibb] src-483 `typ-483))
2736++ test-types-union-context-flow
2742++ test-types-union-context-flow
2737− (weld (check ~.types-union-context-flow src-483 `tok-483 `tre-483) (check-types ~.types-union-context-flow ~[%tests %golden ~.types-union-context-flow %source %jibb] src-483 `typ-483))
2743+ (weld (check ~.types-union-context-flow src-484 `tok-484 `tre-484) (check-types ~.types-union-context-flow ~[%tests %golden ~.types-union-context-flow %source %jibb] src-484 `typ-484))
2738++ test-types-union-import
2744++ test-types-union-import
2739− (weld (weld (check ~.types-union-import src-484 `tok-484 `tre-484) (check-module-types ~.types-union-import ~[%tests %golden ~.types-union-import %source %jibb] src-484 `typ-484 ~ ~ ~[['/ui/lib.jibb' ~[~.ui ~.lib ~.jibb] mod-484-1]])) (check-module-trees ~.types-union-import `mtre-484 ~[['/ui/lib.jibb' ~[~.ui ~.lib ~.jibb] mod-484-1]]))
2745+ (weld (weld (check ~.types-union-import src-485 `tok-485 `tre-485) (check-module-types ~.types-union-import ~[%tests %golden ~.types-union-import %source %jibb] src-485 `typ-485 ~ ~ ~[['/ui/lib.jibb' ~[~.ui ~.lib ~.jibb] mod-485-1]])) (check-module-trees ~.types-union-import `mtre-485 ~[['/ui/lib.jibb' ~[~.ui ~.lib ~.jibb] mod-485-1]]))
2740++ test-types-union-local-pending
2746++ test-types-union-local-pending
2741− (weld (check ~.types-union-local-pending src-485 `tok-485 `tre-485) (check-types ~.types-union-local-pending ~[%tests %golden ~.types-union-local-pending %source %jibb] src-485 `typ-485))
2747+ (weld (check ~.types-union-local-pending src-486 `tok-486 `tre-486) (check-types ~.types-union-local-pending ~[%tests %golden ~.types-union-local-pending %source %jibb] src-486 `typ-486))
2742++ test-types-union-overlap
2748++ test-types-union-overlap
2743− (weld (check ~.types-union-overlap src-486 `tok-486 `tre-486) (check-types ~.types-union-overlap ~[%tests %golden ~.types-union-overlap %source %jibb] src-486 `typ-486))
2749+ (weld (check ~.types-union-overlap src-487 `tok-487 `tre-487) (check-types ~.types-union-overlap ~[%tests %golden ~.types-union-overlap %source %jibb] src-487 `typ-487))
2744++ test-types-union-overlap-nested
2750++ test-types-union-overlap-nested
2745− (weld (check ~.types-union-overlap-nested src-487 `tok-487 `tre-487) (check-types ~.types-union-overlap-nested ~[%tests %golden ~.types-union-overlap-nested %source %jibb] src-487 `typ-487))
2751+ (weld (check ~.types-union-overlap-nested src-488 `tok-488 `tre-488) (check-types ~.types-union-overlap-nested ~[%tests %golden ~.types-union-overlap-nested %source %jibb] src-488 `typ-488))
2746++ test-types-union-phantom-generic
2752++ test-types-union-phantom-generic
2747− (weld (check ~.types-union-phantom-generic src-488 `tok-488 `tre-488) (check-types ~.types-union-phantom-generic ~[%tests %golden ~.types-union-phantom-generic %source %jibb] src-488 `typ-488))
2753+ (weld (check ~.types-union-phantom-generic src-489 `tok-489 `tre-489) (check-types ~.types-union-phantom-generic ~[%tests %golden ~.types-union-phantom-generic %source %jibb] src-489 `typ-489))
2748++ test-types-union-print-cross-namespace
2754++ test-types-union-print-cross-namespace
2749− (weld (weld (check ~.types-union-print-cross-namespace src-489 `tok-489 `tre-489) (check-module-types ~.types-union-print-cross-namespace ~[%tests %golden ~.types-union-print-cross-namespace %source %jibb] src-489 `typ-489 ~ ~ ~[['/ui/lib.jibb' ~[~.ui ~.lib ~.jibb] mod-489-1]])) (check-module-trees ~.types-union-print-cross-namespace `mtre-489 ~[['/ui/lib.jibb' ~[~.ui ~.lib ~.jibb] mod-489-1]]))
2755+ (weld (weld (check ~.types-union-print-cross-namespace src-490 `tok-490 `tre-490) (check-module-types ~.types-union-print-cross-namespace ~[%tests %golden ~.types-union-print-cross-namespace %source %jibb] src-490 `typ-490 ~ ~ ~[['/ui/lib.jibb' ~[~.ui ~.lib ~.jibb] mod-490-1]])) (check-module-trees ~.types-union-print-cross-namespace `mtre-490 ~[['/ui/lib.jibb' ~[~.ui ~.lib ~.jibb] mod-490-1]]))
2750++ test-types-union-print-distinct
2756++ test-types-union-print-distinct
2751− (weld (weld (check ~.types-union-print-distinct src-490 `tok-490 `tre-490) (check-module-types ~.types-union-print-distinct ~[%tests %golden ~.types-union-print-distinct %source %jibb] src-490 `typ-490 ~ ~ ~[['/ui/left.jibb' ~[~.ui ~.left ~.jibb] mod-490-1] ['/ui/right.jibb' ~[~.ui ~.right ~.jibb] mod-490-2] ['/ui/twin.jibb' ~[~.ui ~.twin ~.jibb] mod-490-3]])) (check-module-trees ~.types-union-print-distinct `mtre-490 ~[['/ui/left.jibb' ~[~.ui ~.left ~.jibb] mod-490-1] ['/ui/right.jibb' ~[~.ui ~.right ~.jibb] mod-490-2] ['/ui/twin.jibb' ~[~.ui ~.twin ~.jibb] mod-490-3]]))
2757+ (weld (weld (check ~.types-union-print-distinct src-491 `tok-491 `tre-491) (check-module-types ~.types-union-print-distinct ~[%tests %golden ~.types-union-print-distinct %source %jibb] src-491 `typ-491 ~ ~ ~[['/ui/left.jibb' ~[~.ui ~.left ~.jibb] mod-491-1] ['/ui/right.jibb' ~[~.ui ~.right ~.jibb] mod-491-2] ['/ui/twin.jibb' ~[~.ui ~.twin ~.jibb] mod-491-3]])) (check-module-trees ~.types-union-print-distinct `mtre-491 ~[['/ui/left.jibb' ~[~.ui ~.left ~.jibb] mod-491-1] ['/ui/right.jibb' ~[~.ui ~.right ~.jibb] mod-491-2] ['/ui/twin.jibb' ~[~.ui ~.twin ~.jibb] mod-491-3]]))
2752++ test-types-union-print-escape
2758++ test-types-union-print-escape
2753− (weld (check ~.types-union-print-escape src-491 `tok-491 `tre-491) (check-types ~.types-union-print-escape ~[%tests %golden ~.types-union-print-escape %source %jibb] src-491 `typ-491))
2759+ (weld (check ~.types-union-print-escape src-492 `tok-492 `tre-492) (check-types ~.types-union-print-escape ~[%tests %golden ~.types-union-print-escape %source %jibb] src-492 `typ-492))
2754++ test-types-union-print-local
2760++ test-types-union-print-local
2755− (weld (check ~.types-union-print-local src-492 `tok-492 `tre-492) (check-types ~.types-union-print-local ~[%tests %golden ~.types-union-print-local %source %jibb] src-492 `typ-492))
2761+ (weld (check ~.types-union-print-local src-493 `tok-493 `tre-493) (check-types ~.types-union-print-local ~[%tests %golden ~.types-union-print-local %source %jibb] src-493 `typ-493))
2756++ test-types-union-print-nested
2762++ test-types-union-print-nested
2757− (weld (check ~.types-union-print-nested src-493 `tok-493 `tre-493) (check-types ~.types-union-print-nested ~[%tests %golden ~.types-union-print-nested %source %jibb] src-493 `typ-493))
2763+ (weld (check ~.types-union-print-nested src-494 `tok-494 `tre-494) (check-types ~.types-union-print-nested ~[%tests %golden ~.types-union-print-nested %source %jibb] src-494 `typ-494))
2758++ test-types-union-print-same-origin
2764++ test-types-union-print-same-origin
2759− (weld (weld (check ~.types-union-print-same-origin src-494 `tok-494 `tre-494) (check-module-types ~.types-union-print-same-origin ~[%tests %golden ~.types-union-print-same-origin %source %jibb] src-494 `typ-494 ~ ~ ~[['/ui/shared.jibb' ~[~.ui ~.shared ~.jibb] mod-494-1]])) (check-module-trees ~.types-union-print-same-origin `mtre-494 ~[['/ui/shared.jibb' ~[~.ui ~.shared ~.jibb] mod-494-1]]))
2765+ (weld (weld (check ~.types-union-print-same-origin src-495 `tok-495 `tre-495) (check-module-types ~.types-union-print-same-origin ~[%tests %golden ~.types-union-print-same-origin %source %jibb] src-495 `typ-495 ~ ~ ~[['/ui/shared.jibb' ~[~.ui ~.shared ~.jibb] mod-495-1]])) (check-module-trees ~.types-union-print-same-origin `mtre-495 ~[['/ui/shared.jibb' ~[~.ui ~.shared ~.jibb] mod-495-1]]))
2760++ test-types-union-print-transitive
2766++ test-types-union-print-transitive
2761− (weld (weld (check ~.types-union-print-transitive src-495 `tok-495 `tre-495) (check-module-types ~.types-union-print-transitive ~[%tests %golden ~.types-union-print-transitive %source %jibb] src-495 `typ-495 ~ ~ ~[['/ui/mid.jibb' ~[~.ui ~.mid ~.jibb] mod-495-1] ['/ui/base.jibb' ~[~.ui ~.base ~.jibb] mod-495-2]])) (check-module-trees ~.types-union-print-transitive `mtre-495 ~[['/ui/mid.jibb' ~[~.ui ~.mid ~.jibb] mod-495-1] ['/ui/base.jibb' ~[~.ui ~.base ~.jibb] mod-495-2]]))
2767+ (weld (weld (check ~.types-union-print-transitive src-496 `tok-496 `tre-496) (check-module-types ~.types-union-print-transitive ~[%tests %golden ~.types-union-print-transitive %source %jibb] src-496 `typ-496 ~ ~ ~[['/ui/mid.jibb' ~[~.ui ~.mid ~.jibb] mod-496-1] ['/ui/base.jibb' ~[~.ui ~.base ~.jibb] mod-496-2]])) (check-module-trees ~.types-union-print-transitive `mtre-496 ~[['/ui/mid.jibb' ~[~.ui ~.mid ~.jibb] mod-496-1] ['/ui/base.jibb' ~[~.ui ~.base ~.jibb] mod-496-2]]))
2762++ test-types-union-singleton
2768++ test-types-union-singleton
2763− (weld (check ~.types-union-singleton src-496 `tok-496 `tre-496) (check-types ~.types-union-singleton ~[%tests %golden ~.types-union-singleton %source %jibb] src-496 `typ-496))
2769+ (weld (check ~.types-union-singleton src-497 `tok-497 `tre-497) (check-types ~.types-union-singleton ~[%tests %golden ~.types-union-singleton %source %jibb] src-497 `typ-497))
2764++ test-types-union-tag-atoms
2770++ test-types-union-tag-atoms
2765− (weld (check ~.types-union-tag-atoms src-497 `tok-497 `tre-497) (check-types ~.types-union-tag-atoms ~[%tests %golden ~.types-union-tag-atoms %source %jibb] src-497 `typ-497))
2771+ (weld (check ~.types-union-tag-atoms src-498 `tok-498 `tre-498) (check-types ~.types-union-tag-atoms ~[%tests %golden ~.types-union-tag-atoms %source %jibb] src-498 `typ-498))
2766++ test-types-union-tags
2772++ test-types-union-tags
2767− (weld (check ~.types-union-tags src-498 `tok-498 `tre-498) (check-types ~.types-union-tags ~[%tests %golden ~.types-union-tags %source %jibb] src-498 `typ-498))
2773+ (weld (check ~.types-union-tags src-499 `tok-499 `tre-499) (check-types ~.types-union-tags ~[%tests %golden ~.types-union-tags %source %jibb] src-499 `typ-499))
2768++ test-types-union-unresolved
2774++ test-types-union-unresolved
2769− (weld (check ~.types-union-unresolved src-499 `tok-499 `tre-499) (check-types ~.types-union-unresolved ~[%tests %golden ~.types-union-unresolved %source %jibb] src-499 `typ-499))
2775+ (weld (check ~.types-union-unresolved src-500 `tok-500 `tre-500) (check-types ~.types-union-unresolved ~[%tests %golden ~.types-union-unresolved %source %jibb] src-500 `typ-500))
2770++ test-types-union-unresolved-flow
2776++ test-types-union-unresolved-flow
2771− (weld (check ~.types-union-unresolved-flow src-500 `tok-500 `tre-500) (check-types ~.types-union-unresolved-flow ~[%tests %golden ~.types-union-unresolved-flow %source %jibb] src-500 `typ-500))
2777+ (weld (check ~.types-union-unresolved-flow src-501 `tok-501 `tre-501) (check-types ~.types-union-unresolved-flow ~[%tests %golden ~.types-union-unresolved-flow %source %jibb] src-501 `typ-501))
2772++ test-types-unit-context
2778++ test-types-unit-context
2773− (weld (check ~.types-unit-context src-501 `tok-501 `tre-501) (check-types ~.types-unit-context ~[%tests %golden ~.types-unit-context %source %jibb] src-501 `typ-501))
2779+ (weld (check ~.types-unit-context src-502 `tok-502 `tre-502) (check-types ~.types-unit-context ~[%tests %golden ~.types-unit-context %source %jibb] src-502 `typ-502))
2774++ test-types-unit-patterns
2780++ test-types-unit-patterns
2775− (weld (check ~.types-unit-patterns src-502 `tok-502 `tre-502) (check-types ~.types-unit-patterns ~[%tests %golden ~.types-unit-patterns %source %jibb] src-502 `typ-502))
2781+ (weld (check ~.types-unit-patterns src-503 `tok-503 `tre-503) (check-types ~.types-unit-patterns ~[%tests %golden ~.types-unit-patterns %source %jibb] src-503 `typ-503))
2776::
2782::
2777:: +check: run golden:jibb on a case and compare both outputs
2783:: +check: run golden:jibb on a case and compare both outputs
2778::
2784::