From 2430a92302b55953fb8dd466258c51b8e23b1b68 Mon Sep 17 00:00:00 2001 From: Lucas Kramer Date: Sat, 18 Jan 2025 16:03:43 -0600 Subject: [PATCH 1/2] Revert "Disable comparison of dataness/trackedness in NT unification" This reverts commit 42e8abd94be637329107417828c11b640aa19801. --- grammars/silver/compiler/definition/type/Unification.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammars/silver/compiler/definition/type/Unification.sv b/grammars/silver/compiler/definition/type/Unification.sv index b1b299ca9..cbc9b3b56 100644 --- a/grammars/silver/compiler/definition/type/Unification.sv +++ b/grammars/silver/compiler/definition/type/Unification.sv @@ -109,7 +109,7 @@ top::Type ::= fn::String ks::[Kind] data::Boolean tracked::Boolean top.unify = case top.unifyWith of | nonterminalType(ofn, oks, odata, otracked) -> - if fn == ofn --&& data == odata && tracked == otracked -- Mismatched data/tractness can happen when comparing interface files + if fn == ofn && data == odata && tracked == otracked -- Mismatched data/tractness can happen when comparing interface files then if ks == oks then emptySubst() else error("kind mismatch during unification for " ++ prettyType(^top) ++ " and " ++ prettyType(top.unifyWith)) -- Should be impossible From fd82d324c0c4703c7209cd125dfae48cb53a989a Mon Sep 17 00:00:00 2001 From: Lucas Kramer Date: Sat, 18 Jan 2025 17:23:52 -0600 Subject: [PATCH 2/2] Fix trackedness of references to Strategy NT --- grammars/silver/compiler/extension/rewriting/Rewriting.sv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grammars/silver/compiler/extension/rewriting/Rewriting.sv b/grammars/silver/compiler/extension/rewriting/Rewriting.sv index 77189bd7c..09698da89 100644 --- a/grammars/silver/compiler/extension/rewriting/Rewriting.sv +++ b/grammars/silver/compiler/extension/rewriting/Rewriting.sv @@ -51,7 +51,7 @@ top::Expr ::= 'traverse' n::QName '(' es::AppExprs ',' anns::AnnoAppExprs ')' local numChildren::Integer = n.lookupValue.typeScheme.arity; local annotations::[String] = map(fst, n.lookupValue.typeScheme.typerep.namedTypes); - es.appExprTypereps = repeat(nonterminalType("silver:rewrite:Strategy", [], false, false), numChildren); + es.appExprTypereps = repeat(nonterminalType("silver:rewrite:Strategy", [], false, true), numChildren); es.appExprApplied = n.unparse; es.decSiteVertexInfo = nothing(); es.dispatchFlowDeps = []; @@ -59,7 +59,7 @@ top::Expr ::= 'traverse' n::QName '(' es::AppExprs ',' anns::AnnoAppExprs ')' es.appIndexOffset = 0; anns.appExprApplied = n.unparse; anns.funcAnnotations = - map(pair(fst=_, snd=nonterminalType("silver:rewrite:Strategy", [], false, false)), annotations); + map(pair(fst=_, snd=nonterminalType("silver:rewrite:Strategy", [], false, true)), annotations); anns.remainingFuncAnnotations = anns.funcAnnotations; local localErrors::[Message] =