mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-07 08:33:50 +08:00
Keep the branded-primitive rule compilable by the self-hosted frontend
Once shadow mode imports the normalizer, the self-hosted frontend lowers it, and it cannot compare union-typed canonical nodes by identity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5c14941617
commit
f03741b03e
@@ -392,7 +392,8 @@ export class Normalizer {
|
||||
return arms.length === 1 ? arms[0]! : { k: "union", arms };
|
||||
}
|
||||
const prims = parts.filter((p) => p.k === "prim" || p.k === "lit");
|
||||
if (prims.length === 1 && parts.every((p) => p === prims[0] || p.k === "obj")) return prims[0]!;
|
||||
if (prims.length === 1 && parts.every((p) => p.k === "prim" || p.k === "lit" || p.k === "obj"))
|
||||
return prims[0]!;
|
||||
if (parts.every((p) => p.k === "obj" || (p.k === "top" && p.t === "object")))
|
||||
return this.object(type, env, key);
|
||||
return { k: "opaque", ts: type, reason: "intersection" };
|
||||
|
||||
Reference in New Issue
Block a user