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

Disallow local byref void methods. #8945

Merged
merged 2 commits into from
Feb 20, 2016
Merged

Disallow local byref void methods. #8945

merged 2 commits into from
Feb 20, 2016

Conversation

VSadov
Copy link
Member

@VSadov VSadov commented Feb 19, 2016

Disallow local byref void methods.

Fixes #8441

@VSadov
Copy link
Member Author

VSadov commented Feb 19, 2016

@dotnet/roslyn-compiler - please take a look
Fairly trivial fix.
I am mostly trying to see if branch is ok after merge of byrefs and can accept fixes.

@@ -168,6 +168,13 @@ internal TypeSymbol ComputeReturnType()
// The return type of an async method must be void, Task or Task<T>
diagnostics.Add(ErrorCode.ERR_BadAsyncReturn, this.Locations[0]);
}

var returnsVoid = returnType.SpecialType == SpecialType.System_Void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider inlining the local, why calculate this for methods without ref return.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. Thanks

@AlekseyTs
Copy link
Contributor

LGTM

VSadov added a commit that referenced this pull request Feb 20, 2016
Disallow local byref void methods.
@VSadov VSadov merged commit be01c75 into dotnet:future Feb 20, 2016
@VSadov VSadov deleted the fix8441 branch June 29, 2017 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants