mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-02 07:43:42 +08:00
An interface's generic method whose own type parameter is constrained by the enclosing type's parameter (run<T extends TApi>(item: Item<T>)), implemented by a plain contextually typed lambda, compiles since #2274: the lambda takes the contextual signature's type parameters and lowers once, erased. The merged corpus only covers unconstrained contextual generics, so this program pins the constrained shape with a conditional member on the argument type, explicit and inferred call type arguments, the class-body form, and record-held receivers. Verified against the 2026-10-23 base checkout, where the same shape refused with SC2009 (Item<T>'s member 'api' has type 'T'), and the pi models.ts:1159 Model<T> 'compat' shape refused the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>