-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Roslyn 5.0.0 #3588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roslyn 5.0.0 #3588
Conversation
|
Supersedes #3517 |
f8182b1 to
b45eaca
Compare
5842d53 to
396b580
Compare
There was a problem hiding this 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.
| return IdentityConversion(elementType, toType.TypeArguments[0]) | ||
| || IsImplicitReferenceConversion(elementType, toType.TypeArguments[0]); |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
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(...);
| 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; |
| return IdentityConversion(pt.TypeArguments[0], toType.TypeArguments[0]) | ||
| || IsImplicitReferenceConversion(pt.TypeArguments[0], toType.TypeArguments[0]); |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
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.
dotnet/roslyn#80213
#3539