mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
Declining every type-parameter operand was too broad. The reason a type parameter has no lambda spelling is that `v == other` is CS0019 and boxing both operands compares box identity where the tree compares values - and both only apply while the parameter may be a value type. A parameter constrained to a reference type compares as a reference, which is what the tree asks for and what `t == null` spells, so it converts like any other reference comparison. IsReferenceType is the distinction the type system already makes here: TypeUtils.GetStackType maps a type parameter to Obj or VT by the same question. An unconstrained parameter answers null and keeps declining. Assisted-by: Claude:claude-opus-5:Claude Codepull/4091/head
2 changed files with 29 additions and 5 deletions
Loading…
Reference in new issue