Files
ILSpy/ICSharpCode.Decompiler/TypeSystem
Siegfried Pammer 4bc51e6083 Drop isReferenceType when erasing unknown types
Whether an unresolvable type is a reference type is not a property of the
type but of the metadata that mentioned it: a signature spelling it
`valuetype T` yields false, a bare TypeRef yields null. UnknownType.Equals
compares the flag, so the two spellings of one missing type compared
unequal and EquivalentTypes reported false - the decompiler then emitted a
cast between a type and itself.

Erasing the flag in NormalizeTypeVisitor keeps the relaxation inside the
comparisons that ask for erasure, next to the nullability, modopt and tuple
erasure that are use-site spellings of the same kind. Dropping the term
from UnknownType.Equals instead was measured and rejected: Equals also keys
CSharpConversions' implicit-conversion cache, where merging the two
spellings lets whichever conversion is computed first answer for both,
adding 398 boxing casts across two real-world assemblies.

Assisted-by: Claude:claude-opus-5[1m]:Claude Code
2026-08-29 18:17:51 +02:00
..
2025-08-28 20:56:19 -04:00
2025-08-28 20:56:19 -04:00
2025-08-28 20:56:19 -04:00
2025-08-28 20:56:19 -04:00
2025-08-28 20:56:19 -04:00
2025-12-29 19:24:31 +01:00