Skip to content

__arglist cannot have an argument passed by 'in' or 'out'#26130

Merged
OmarTawfik merged 3 commits intodotnet:masterfrom
OmarTawfik:fix-22455-arglist-in-out
Apr 17, 2018
Merged

__arglist cannot have an argument passed by 'in' or 'out'#26130
OmarTawfik merged 3 commits intodotnet:masterfrom
OmarTawfik:fix-22455-arglist-in-out

Conversation

@OmarTawfik
Copy link
Copy Markdown
Contributor

Fixes #22455

cc @VSadov @dotnet/roslyn-compiler

@OmarTawfik OmarTawfik added this to the 15.8 milestone Apr 13, 2018
@OmarTawfik OmarTawfik self-assigned this Apr 13, 2018
@OmarTawfik OmarTawfik requested review from a team and VSadov April 13, 2018 00:24
Copy link
Copy Markdown
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

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

:shipit:

Copy link
Copy Markdown
Contributor

@cston cston Apr 13, 2018

Choose a reason for hiding this comment

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

Does the out change need to be recorded as a breaking change? #Resolved

Copy link
Copy Markdown
Contributor

@cston cston Apr 13, 2018

Choose a reason for hiding this comment

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

Consider extracting a local for analyzedArguments.RefKind(i) for use here and in switch (refKind). #Resolved

Copy link
Copy Markdown
Member

@VSadov VSadov left a comment

Choose a reason for hiding this comment

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

LGTM
Breaking change doc needs to be updated - for out

Copy link
Copy Markdown
Contributor

@AlekseyTs AlekseyTs Apr 13, 2018

Choose a reason for hiding this comment

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

throw ExceptionUtilities.UnexpectedValue(analyzedArguments.RefKind(i)); [](start = 24, length = 71)

throw ExceptionUtilities.UnexpectedValue(analyzedArguments.RefKind(i)); [](start = 24, length = 71)

I think it is better to not throw here, but instead check for kinds that we support. We support None and Ref, for everything else it is safe to report an error and I believe it is better than throwing. #Closed

Copy link
Copy Markdown
Contributor Author

@OmarTawfik OmarTawfik Apr 13, 2018

Choose a reason for hiding this comment

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

What do you suggest to put in the diagnostic message instead? the notion of "refkind" is not public or intuitive, and the current one only mentions in and out. #Resolved

Copy link
Copy Markdown
Contributor

@AlekseyTs AlekseyTs Apr 13, 2018

Choose a reason for hiding this comment

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

What do you suggest to put in the diagnostic message instead? the notion of "refkind" is not public or intuitive, and the current one only mentions in and out.

I suggest to go with the message you have. It covers what we have today and, once we add a new kind, we either adjust the condition of the message. #Closed

Copy link
Copy Markdown
Contributor

@AlekseyTs AlekseyTs Apr 13, 2018

Choose a reason for hiding this comment

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

If we fail to make an adjustment in the future, we end up with inaccurate error message, which is much better than a crash. #Closed

@AlekseyTs
Copy link
Copy Markdown
Contributor

AlekseyTs commented Apr 13, 2018

Done with review pass (iteration 2). #Closed

@OmarTawfik
Copy link
Copy Markdown
Contributor Author

@cston @AlekseyTs comments addressed.

Copy link
Copy Markdown
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (iteration 3)

@OmarTawfik OmarTawfik merged commit afc3b51 into dotnet:master Apr 17, 2018
@OmarTawfik OmarTawfik deleted the fix-22455-arglist-in-out branch April 17, 2018 02:07
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.

5 participants