Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5def9d7
A generic record literal admits the wrong field type silently at six …
Aug 22, 2026
b4c59fe
Correct the mechanism: substitution is innocent, the class is any typ…
Aug 22, 2026
84c65c3
The class is two rows, and the corpus reds the closed one: report it …
Aug 22, 2026
6552623
The 8 and the 4 have different dispositions: the census rows encode t…
Aug 22, 2026
e636aca
LexMatchThunk is not generic, so it is none of the three rows: a four…
Aug 22, 2026
871e2ea
Withdrawn: the generic carrier is the algebra, not the thunk -- one-v…
Aug 22, 2026
ca11d6f
Merge main (19f0be86dd) to re-anchor measurements
Aug 22, 2026
6df8af2
WIP: (a) fork dissolution — field_declared_type_node, authority + mirror
Aug 22, 2026
57990af
(a) mirror half restored: field_declared_type_node in v1_compiler_inf…
Aug 22, 2026
4040170
Drop stray backup file
Aug 22, 2026
caf490b
(a) fork dissolution + measured (c) exposure; placeholder-carrier hyp…
Aug 22, 2026
2b7a17a
(c) an UNESTABLISHED return type must not become a lambda's body expe…
Aug 22, 2026
f5be77a
Merge main (abf7194e2b) — absorb after hold lift
Aug 22, 2026
ffddac8
Install the emitted mirror for v1_compiler_infer.rs (regen candidate,…
Aug 22, 2026
0c93747
Delete four dissolved frontier rows (observed=0), fix two ContentHash…
Aug 22, 2026
6b6ad94
(c) sibling: an UNESTABLISHED substituted param type must not bind a …
Aug 23, 2026
6657825
Merge main (2879ab241d)
Aug 23, 2026
df90bc8
Install emitted mirror for v1_compiler_emit_rust.rs (clone elision fr…
Aug 23, 2026
974ac5d
Merge main (c07d13a49f)
Aug 23, 2026
18b5ddc
BISECT ARM (not a landing state): revert (a) field_substitution_carri…
Aug 23, 2026
1626a9e
Revert "BISECT ARM (not a landing state): revert (a) field_substituti…
Aug 23, 2026
ea093d4
Merge main (13db52a25d9) — after #8989 restored parse
Aug 23, 2026
c1ab0cd
Merge main — after the eight width identities were repaired (#8998, #…
Aug 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/v1/04_infer.dag
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,22 @@ fn record_lit_fields_from_expected(type_name: String?, expected: Node?, scope: I
}
}

fn field_type_expr_is_stripped_placeholder(te: Node, source_indices: Map<String, NewlineIndex>) -> Bool {
authored_name_at(source_indices: source_indices, node: te) == ""
&& te.children |> count == 0
&& te.params |> count == 0
}

fn field_substitution_carrier(sf: Node, source_indices: Map<String, NewlineIndex>) -> Node {
let te = field_node_type_expr(n: sf)
if field_type_expr_is_stripped_placeholder(te: te, source_indices: source_indices) {
match sf.inferred {
Present { value: Resolved { node: rt } } => preserve_outer_optional_cardinality(outer: sf, inner: rt)
_ => te
}
} else { te }
}

fn record_lit_instantiated_fields(type_name: String?, expected: Node?, scope: InferScope) -> List<Node>? {
match type_name {
Present { value: tn } =>
Expand Down Expand Up @@ -1139,7 +1155,7 @@ fn record_lit_instantiated_fields(type_name: String?, expected: Node?, scope: In
Node {
name: sf.name, span: sf.span, ident_span: sf.ident_span,
children: sf.children, connective: sf.connective, params: sf.params,
inferred: Present { value: Resolved { node: substitute_generics(n: field_node_type_expr(n: sf), subst: subst, source_indices: scope.type_env.source_indices) } },
inferred: Present { value: Resolved { node: substitute_generics(n: field_substitution_carrier(sf: sf, source_indices: scope.type_env.source_indices), subst: subst, source_indices: scope.type_env.source_indices) } },
return_cardinality: sf.return_cardinality, uses: sf.uses, body: sf.body,
transport: sf.transport, properties: sf.properties,
type_annotation: sf.type_annotation, is_self_recursive: sf.is_self_recursive,
Expand Down
35 changes: 34 additions & 1 deletion src/v1/stage0/src/v1_compiler_infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,32 @@ pub fn record_lit_fields_from_expected(
}
}

pub fn field_type_expr_is_stripped_placeholder(
te: Rc<Node>,
source_indices: Rc<HashMap<String, Rc<NewlineIndex>>>,
) -> bool {
authored_name_at(source_indices.clone(), te.clone()) == *""
&& te.children.len() == 0
&& te.params.len() == 0
}

pub fn field_substitution_carrier(
sf: Rc<Node>,
source_indices: Rc<HashMap<String, Rc<NewlineIndex>>>,
) -> Rc<Node> {
let te = field_node_type_expr(sf.clone());
if field_type_expr_is_stripped_placeholder(te.clone(), source_indices.clone()) {
match sf.inferred.as_deref() {
Some(InferredNode::Resolved { node: rt }) => {
preserve_outer_optional_cardinality(sf.clone(), rt.clone())
}
_ => te.clone(),
}
} else {
te.clone()
}
}

pub fn record_lit_instantiated_fields(
type_name: Option<String>,
expected: Option<Rc<Node>>,
Expand Down Expand Up @@ -1758,7 +1784,14 @@ match exp.children.clone().iter().cloned().skip(pair.0.clone() as usize).next()
inferred: Some(Rc::new(
InferredNode::Resolved {
node: substitute_generics(
field_node_type_expr(sf.clone()),
field_substitution_carrier(
sf.clone(),
scope
.type_env
.clone()
.source_indices
.clone(),
),
subst.clone(),
scope
.type_env
Expand Down
Loading