A tool to update the Roslyn compiler and C# language versions for a Unity installation.
NOTE: This will modify your Unity installation folder, administrative privileges are required!
UnityRoslynUpdater.exe <path to Unity Editor folder>
For example: UnityRoslynUpdater.exe "C:\Program Files\Unity\Hub\Editor\2022.3.8f1\Editor"
- Working
- Feature works exactly as expected.
- PolySharp
- Feature works when using PolySharp and/or manually implementing missing APIs.
- Not Supported
- Requires runtime features or BCL changes that Unity does not have. Attempting to use the feature may result in compiler errors.
- Crash
- Requires runtime features that Unity does not have. Attempting to use the feature may compile, but will result in crashes.
Feature | Status |
---|---|
Primary constructors | Working |
Optional parameters in lambda expressions | Working |
Alias any type | Working |
Inline arrays | Not Supported |
Collection expressions | Working |
Interceptors | Not Supported |
Feature | Status |
---|---|
Raw string literals | Working |
static abstract /static virtual members in interfaces |
Not Supported |
Checked user defined operators | Working |
Relaxed shift operators | Working |
Unsigned right-shift operator | Working |
Generic attributes | Crash |
UTF-8 string literals | Working |
Newlines in string interpolations | Working |
List patterns | Working |
File-local types | Working |
Required members | PolySharp |
Auto-default structs | Working |
Pattern match Span<char> or ReadOnlySpan<char> on a constant string |
Working |
Extended nameof scope | Working |
Numeric IntPtr and UIntPtr |
Working |
ref fields |
Not Supported |
ref scoped variables |
PolySharp |
Improved method group conversion to delegate | Working |
Feature | Status |
---|---|
Record structs | Working |
Improvements of structure types | Working |
Interpolated string handler | PolySharp |
Global using directives | Working |
File-scoped namespace declaration | Working1 |
Extended property patterns | Working |
Lambda expression improvements | Working |
Constant interpolated strings | Working |
Record types can seal ToString | Working |
Assignment and declaration in same deconstruction | Working |
Improved definite assignment | Working |
Allow AsyncMethodBuilder attribute on methods | Not Supported2 |
CallerArgumentExpression attribute | PolySharp |
Enhanced #line pragma | Working |
- Unity 2021 and earlier require UnityNamespacePatch to be installed.
AsyncMethodBuilderAttribute
requires changes to its[AttributeUsage]
attribute for this to work.