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 warning for member invocation on readonly value type field #10

Open
citizenmatt opened this issue Jul 17, 2014 · 1 comment
Open

Comments

@citizenmatt
Copy link
Contributor

Member invocation on a readonly value type field causes a temporary copy of the field to be made before invocation.

From Mr Skeet:
http://msmvps.com/blogs/jon_skeet/archive/2014/07/16/micro-optimization-the-surprising-inefficiency-of-readonly-fields.aspx

@controlflow
Copy link
Owner

note for myself: Roslyn also emits copying of value type when invoking instance member over immutable variable ('foreach' variable, 'from' range variable, 'let' query clause, 'using' variable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants