mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-08 08:44:37 +08:00
A Pick or Omit view of a program class is held as a live class protocol, and generic methods called through it monomorphize against the class. Both checks read the view from the type's alias symbol, but a view named by a type alias (type View = Pick<Registry, "m">) carries the user's alias instead, so it mapped to a record of erased method fields that no instance converts to. classViewOf reads the alias declaration and sees the view through non-generic aliases, alias chains included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 lines
154 B
TypeScript
4 lines
154 B
TypeScript
import { Registry } from "./registry.ts";
|
|
import { run } from "./globals.ts";
|
|
console.log(run({ registry: new Registry(), label: "L" }), run(undefined));
|