Skip to content
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

Add missing readonly modifiers #1513

merged 1 commit into from Sep 7, 2019


Copy link

commented Sep 6, 2019

Ask Mode 3.0 GA: Fix missing read-only modifiers


C# 8 adds the ability to apply the readonly modifier to members. This allows the compiler to avoid defensive copies of structs when calling methods that don't change the struct's state.

When comparing the reference assemblies between .NET Core and .NET Standard we were using an older language version to generate the C# representation of the reference assemblies. This resulted in us not marking the .NET Standard version of certain .NET Core APIs as readonly.

Customer Impact

Reduced performance.

How found

Reported by @stephentoub.




Risk is very small. .NET Standard just exposes the API that already exists in .NET Core.

@terrajobst terrajobst requested review from dotnet/nsboard-foundation as code owners Sep 6, 2019

@terrajobst terrajobst removed request for dotnet/nsboard-foundation Sep 6, 2019

@terrajobst terrajobst force-pushed the terrajobst:readonly-modifiers branch from aff2f7d to 22ae84e Sep 7, 2019

@terrajobst terrajobst requested a review from stephentoub Sep 7, 2019

@terrajobst terrajobst merged commit a0264c3 into dotnet:release/3.0 Sep 7, 2019

6 checks passed

WIP Ready for review
license/cla All CLA requirements met.
standard-ci Build #20190906.15 succeeded
standard-ci (Build Linux) Build Linux succeeded
standard-ci (Build OSX) Build OSX succeeded
standard-ci (Build Windows_NT) Build Windows_NT succeeded

@terrajobst terrajobst deleted the terrajobst:readonly-modifiers branch Sep 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.