-
Notifications
You must be signed in to change notification settings - Fork 184
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
Upgrade compiler to 7.3 #65
Comments
Just realized that variables that have the "in" keyword assigned are not allowed to be used by LINQ queries... |
Could you elaborate more, or is there any reference on that? Because i have just moved the compiler version to "latest" (latest is 7.3 I suppose), and have tested marking an "in" keyword for inputs in AnalyzableBase class, and the test case runs properly without any issue. |
If that's the case than it works in some situations and may not work for in others. We may have to learn the rules around "in". Compiler complained when put "in" with a function that used that parameter within a LINQ statement. We just need to be sure that any use of "in", there really is no modification of that objection. It's just for reading. And we need to be very careful of using "in" on structs as that can slow things down. |
yea, i agree. We must make sure the suitable use cases of "in" parameter first before we proceed the change. And for the case you've mentioned, could you branch an un-workable version for me to investigate the problem, i mean the "not allowed to be used by LINQ" use case. |
Suitable for value types only. Objects are already passed as byref. |
The latest compiler version 7.3 allows us to take advantage of some good performance features that were not available.
In particular the use of ref, in, out keywords in ways not possible before.
This may be useful especially when dealing with a large amount of candles. Using references instead of objects as it may boost performance.
So for example, the original did without the "in" keyword:
The "in" keyword ensures that the function uses a reference to the actual IEnumerable object, but cannot modify the reference. The original code actually makes a copy of that IEnumerable.
https://dotnetcoretutorials.com/2018/01/08/new-keyword-c-7-2/
The text was updated successfully, but these errors were encountered: