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

Update BoundCall method based on receiver nullability #31000

Merged
merged 4 commits into from
Nov 9, 2018

Conversation

cston
Copy link
Member

@cston cston commented Nov 6, 2018

No description provided.

@jcouv
Copy link
Member

jcouv commented Nov 7, 2018

Fixes #29605? Never mind, that issue covers this scenario but also some PROTOTYPE markers. #Closed


[WorkItem(29605, "https://github.com/dotnet/roslyn/issues/29605")]
[Fact]
public void InferMethodReceiverType_01()
Copy link
Member

@jcouv jcouv Nov 7, 2018

Choose a reason for hiding this comment

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

Is this issue specific to methods? Would it make sense to also test properties or fields?
Oh, I see that you updated VisitMemberAccess too, which covers fields, properties and events. It may still be good to add a test for those (if not covered already). #Closed

Copy link
Member Author

@cston cston Nov 7, 2018

Choose a reason for hiding this comment

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

There are a number of existing tests that rely on the update in VisitMemberAccess, but I've added explicit tests here. #Closed

Copy link
Member

@jcouv jcouv left a 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)

@jcouv jcouv self-assigned this Nov 7, 2018
@jcouv
Copy link
Member

jcouv commented Nov 7, 2018

Should this PR target dev16.0-preview2 instead?

Update: it looks like the snap may not have happened yet. We'll have to check with Andy.

@cston cston closed this Nov 7, 2018
@cston cston reopened this Nov 7, 2018
@cston cston changed the base branch from master to dev16.0-preview2 November 7, 2018 22:36
@cston cston closed this Nov 7, 2018
@cston cston reopened this Nov 7, 2018
@cston
Copy link
Member Author

cston commented Nov 7, 2018

See #30946.

@cston
Copy link
Member Author

cston commented Nov 7, 2018

@dotnet/roslyn-compiler for a second review.

@jcouv jcouv added this to the 16.0.P2 milestone Nov 8, 2018
b3.E += (A<object> a) => { }; // 5
b3.E += (A<object>? a) => { }; // 6
b3.E += (A<object?> a) => { };
b3.E += (A<object?>? a) => { }; // 7
Copy link
Member

Choose a reason for hiding this comment

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

This seems unfortunate, but given that this is already how variance works for lambdas/method groups, I don't see a way to change this without making overload resolution rules extremely convoluted and inconsistent.

Copy link
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.

LGTM (commit 3)

@cston cston closed this Nov 8, 2018
@cston cston reopened this Nov 8, 2018
@cston
Copy link
Member Author

cston commented Nov 9, 2018

@jaredpar for approval

@jaredpar
Copy link
Member

jaredpar commented Nov 9, 2018

approved

@cston cston merged commit ea69e38 into dotnet:dev16.0-preview2 Nov 9, 2018
@cston cston deleted the 29605 branch November 9, 2018 20:37
wachulski added a commit to wachulski/roslyn that referenced this pull request Nov 12, 2018
…out-if-error-message

* origin/master: (174 commits)
  Add Compilers filter for Roslyn (dotnet#30880)
  Remove NonNullTypes context and other unnecessary information stored in TypeSymbolWithAnnotations. (dotnet#30913)
  Update BoundCall method based on receiver nullability (dotnet#31000)
  Make nullabiulity inference associative and commutative (dotnet#30990)
  Async-streams: minimal test for IOperation and CFG. Improve diagnostics (dotnet#30363)
  Add src.
  Add test.
  Remove dead code
  Update the build status table
  Script for generating our build status tables
  Add parsing tests to compiler benchmarks (dotnet#31033)
  Fix Edit and Continue in CPS projects
  Add comment
  Sorting.
  Save work
  Address PR feedback
  only produce optprof data on an official build
  Add bunch of exclusions to dead code analysis for special methods
  Disable WinRT tests on Linux (dotnet#31026)
  Change prerelease version to beta2 (dotnet#31017)
  ...

# Conflicts:
#	src/Compilers/CSharp/Portable/CSharpResources.resx
#	src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
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.

4 participants