mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
Dumping the implicit/explicit classification of all pairs from a 120-type universe and diffing it against what csc actually compiles surfaced two divergences (16 affected pairs), both proven by a compiling-and-running snippet and captured here as ignored known-bug tests: 1. Nullable conversions derived from tuple conversions are missing: csc accepts "(long, object)? a = t;" for t of type (int, string) as well as the lifted and explicit forms, CSharpConversions returns None. The ECMA spec's 10.6.1 does not list tuple conversions as liftable, so this is a case of Roslyn exceeding the spec. 2. An explicit user-defined conversion to a nullable target is rejected when the operator result additionally needs an explicit numeric conversion: csc accepts "(int?)new ImplicitToLong()" (operator to long, then explicit long -> int?), CSharpConversions returns None. The same sweep confirmed the SByte..Decimal TypeCode range in ImplicitEnumerationConversion is correct: csc accepts zero constants of any numeric type (0.0, 0f, 0m) for enum conversion and rejects '\0', matching the implementation exactly. Assisted-by: Claude:claude-fable-5:Claude Codepull/3916/head
2 changed files with 35 additions and 0 deletions
Loading…
Reference in new issue