fix(compiler-cli): honor NoInfer on unbound model/signal inputs#69819
fix(compiler-cli): honor NoInfer on unbound model/signal inputs#69819LordKay-sudo wants to merge 2 commits into
Conversation
Filling missing keys with `any` poisoned generic inference and defeated TypeScript's NoInfer on model/signal write types. Use Partial init types and only pass bound inputs. Fixes angular#69373
Omitting all unbound inputs broke NgIf generic inference and template narrowing. Keep 0-as-any fillers for plain inputs; omit only unbound signal/model inputs so NoInfer still works.
|
This mostly races with #57724 (closed as out-of-date, may be revised, but as mentioned is a breaking change). It's not clear to me why this differentiates behavior between signal vs non-signal types, that seems undesirable. |
|
Thanks. I agree that the signal/non-signal distinction is undesirable. There is no principled type-system reason those should behave differently in the type constructor. The distinction was only a scoped workaround: the split came from narrowing the initial implementation after omitting all unbound inputs via I tested two unified alternatives locally before replying:
So I don't think the signal-only version should land as-is. Would you prefer that I rework this as part of the broader #57724 approach (potentially behind a flag), or close this PR in favor of revising #57724? |
Summary
0 as anyfillers no longer poison generic inference and defeat TypeScript'sNoInfer(fixes Template type checker should respect NoInfer in generic component model inputs #69373).0 as anyso generics likeNgIf<T>still fall back to their default and template narrowing continues to work.NoInferstub in the typecheck test lib.Test plan