Skip to content

A tool to update the Roslyn compiler and C# language versions for a Unity installation.

License

Notifications You must be signed in to change notification settings

DaZombieKiller/UnityRoslynUpdater

Repository files navigation

Unity Roslyn Updater

A tool to update the Roslyn compiler and C# language versions for a Unity installation.

Usage

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"

Language Support

  • 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.

C# 12

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

C# 11

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

C# 10

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
  1. Unity 2021 and earlier require UnityNamespacePatch to be installed.
  2. AsyncMethodBuilderAttribute requires changes to its [AttributeUsage] attribute for this to work.

About

A tool to update the Roslyn compiler and C# language versions for a Unity installation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published