-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Only Left and returnValue gets checked for dynamic in signature #69214
Conversation
In CSharpcompilation there was a signature check for dynamic Types but only left and return were checked
This should resolve #69215. |
@@ -4127,7 +4127,7 @@ void validateSignature() | |||
// Dynamic built-in operators allow virtually all operations with all types. So we do no further checking here. | |||
if (csharpReturnType.TypeKind is TypeKind.Dynamic || | |||
csharpLeftType.TypeKind is TypeKind.Dynamic || | |||
csharpReturnType.TypeKind is TypeKind.Dynamic) | |||
csharpRightType.TypeKind is TypeKind.Dynamic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
definitely looks like a good bug you've caught. :)
would need a test to go along with this. Thsi also might be a breaking change in some way. Compiler will have to look into that and see if this needs to be doc'ed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it will functionally change something because I can't seem to figure out how to have the right dynamic type without a return type that is also dynamic.
As well as I understand the function of the code, the function I don't know if this needs extra checks due to only being Otherwise I would change the code to the following:
I could also add tests to check if it throws when the returntype is non dynamic while left and/or right are dynamic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 1)
@dotnet/roslyn-compiler For the second review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks (iteration 1)
Thanks for the contribution @gero3 ! |
No problem |
In CSharpcompilation there was a signature check for dynamic Types but only left and return were checked. I was running my roslyn analyser to check for identical subexpressions over this repository to get some edgecases that I forgot about. This came out as response