Skip to content

Conversation

@christophwille
Copy link
Member

@christophwille christophwille commented Oct 10, 2025

@christophwille
Copy link
Member Author

Supersedes #3517

@christophwille christophwille added the Decompiler The decompiler engine itself label Oct 10, 2025
@siegfriedpammer siegfriedpammer force-pushed the r502 branch 2 times, most recently from f8182b1 to b45eaca Compare October 23, 2025 15:39
@siegfriedpammer siegfriedpammer changed the title Roslyn 5.0.0-2.final Roslyn 5.0.0 Nov 21, 2025
@siegfriedpammer siegfriedpammer marked this pull request as ready for review November 21, 2025 21:09
Copilot finished reviewing on behalf of christophwille November 24, 2025 08:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the Roslyn compiler packages from version 4.14.0 to 5.0.0 and implements support for C# 14's first-class span types feature. The changes introduce a new language feature that treats Span<T> and ReadOnlySpan<T> as built-in types with special conversion rules.

Key changes:

  • Roslyn package upgrade from 4.14.0 to 5.0.0
  • Implementation of implicit span conversions and type inference for span types
  • New decompiler setting to enable/disable first-class span type treatment
  • Updates to method resolution, overload resolution, and conversion logic to support span conversions

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Directory.Packages.props Upgrades Microsoft.CodeAnalysis packages from 4.14.0 to 5.0.0
ILSpy/Properties/Resources.resx Adds resource string for FirstClassSpanTypes setting
ICSharpCode.Decompiler/DecompilerSettings.cs Adds FirstClassSpanTypes property and integrates it with language version detection
ICSharpCode.Decompiler/TypeSystem/ICompilation.cs Adds TypeSystemOptions property to interface
ICSharpCode.Decompiler/TypeSystem/Implementation/SimpleCompilation.cs Implements TypeSystemOptions property with default value
ICSharpCode.Decompiler/TypeSystem/DecompilerTypeSystem.cs Adds FirstClassSpanTypes flag to TypeSystemOptions enum and updates initialization logic
ICSharpCode.Decompiler/Semantics/Conversion.cs Adds ImplicitSpanConversion type and related properties
ICSharpCode.Decompiler/CSharp/Resolver/CSharpConversions.cs Implements implicit span conversion logic and updates better conversion logic
ICSharpCode.Decompiler/CSharp/Resolver/TypeInference.cs Updates type inference to handle span conversions in MakeExactInference and MakeLowerBoundInference
ICSharpCode.Decompiler/CSharp/Resolver/OverloadResolution.cs Updates extension method validation to allow span conversions
ICSharpCode.Decompiler/CSharp/Resolver/CSharpResolver.cs Updates extension method eligibility check to include span conversions
ICSharpCode.Decompiler/CSharp/CallBuilder.cs Updates method comparison to use TypeErasure
ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs Enables nullable for ExtensionProperties test
ICSharpCode.Decompiler.Tests/Helpers/Tester.cs Updates default language version from CSharp13_0 to CSharp14_0
Files not reviewed (1)
  • ILSpy/Properties/Resources.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1258 to +1259
return IdentityConversion(elementType, toType.TypeArguments[0])
|| IsImplicitReferenceConversion(elementType, toType.TypeArguments[0]);
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The logical OR operation spans multiple lines without clear visual separation. Consider extracting this complex boolean expression into a well-named local variable or helper method to improve readability, such as bool hasValidConversion = IdentityConversion(...) || IsImplicitReferenceConversion(...);

Suggested change
return IdentityConversion(elementType, toType.TypeArguments[0])
|| IsImplicitReferenceConversion(elementType, toType.TypeArguments[0]);
bool hasValidConversion = IdentityConversion(elementType, toType.TypeArguments[0])
|| IsImplicitReferenceConversion(elementType, toType.TypeArguments[0]);
return hasValidConversion;

Copilot uses AI. Check for mistakes.
Comment on lines +1265 to +1266
return IdentityConversion(pt.TypeArguments[0], toType.TypeArguments[0])
|| IsImplicitReferenceConversion(pt.TypeArguments[0], toType.TypeArguments[0]);
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is duplicated logic from lines 1258-1259. Consider extracting this into a helper method like bool HasIdentityOrImplicitReferenceConversion(IType from, IType to) to reduce code duplication.

Copilot uses AI. Check for mistakes.
@christophwille christophwille merged commit f54955a into master Nov 30, 2025
15 checks passed
@christophwille christophwille deleted the r502 branch November 30, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Decompiler The decompiler engine itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants