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

Async-streams: minimal test for IOperation and CFG. Improve diagnostics #30363

Merged
merged 9 commits into from
Nov 9, 2018

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Oct 7, 2018

@jcouv jcouv added this to the 16.0 milestone Oct 7, 2018
@jcouv jcouv self-assigned this Oct 7, 2018
@jcouv jcouv requested a review from a team as a code owner October 7, 2018 18:13
@jcouv jcouv added the PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. label Oct 7, 2018
@jcouv jcouv force-pushed the async-blockers branch 2 times, most recently from 8b787ef to a315820 Compare October 8, 2018 16:50
@jcouv jcouv force-pushed the async-blockers branch 3 times, most recently from 366c16c to d993252 Compare October 12, 2018 15:38
@jcouv jcouv removed the PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. label Oct 12, 2018
@jcouv
Copy link
Member Author

jcouv commented Oct 12, 2018

@dotnet/roslyn-compiler for review. Adding some tests to capture current IOperation/CFG behavior, and improving a diagnostic. Thanks #Closed

Copy link
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 4)

@jcouv jcouv requested review from a team as code owners October 16, 2018 22:18
@jcouv jcouv changed the base branch from features/async-streams to master October 16, 2018 22:19
@jcouv jcouv added the PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. label Oct 16, 2018
@jcouv jcouv changed the base branch from master to dev16.0.x October 16, 2018 22:20
@jcouv
Copy link
Member Author

jcouv commented Nov 8, 2018

Re-targeted to preview2 branch. #Closed

TypeSymbol declType = declarations[0].DeclaredType.Type;

if (declType.IsDynamic())
if (declarationTypeOpt.IsDynamic())
Copy link
Member

@333fred 333fred Nov 8, 2018

Choose a reason for hiding this comment

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

declarationTypeOpt [](start = 20, length = 18)

If this is optional, consider ?. instead. If it is not optional, consider renaming. #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

It's optional in the method, but it's always set in this branch, so I don't see a great way. I could have an extra local for the branch, but that seems overkill :-(


In reply to: 232006228 [](ancestors = 232006228)

Copy link
Member

Choose a reason for hiding this comment

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

You could assert, but I'm ok with this.


In reply to: 232067572 [](ancestors = 232067572,232006228)

{
HashSet<DiagnosticInfo> useSiteDiagnostics = null;

iDisposableConversion = fromExpression ?
Copy link
Member

@333fred 333fred Nov 8, 2018

Choose a reason for hiding this comment

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

Nit: could consider extracting this expression into a local function. #Closed

@@ -2959,9 +2959,15 @@ A catch() block after a catch (System.Exception e) block can catch non-CLS excep
<data name="ERR_NoConvToIDisp" xml:space="preserve">
<value>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'</value>
</data>
<data name="ERR_NoConvToIDispWrongAsync" xml:space="preserve">
<value>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using'?</value>
Copy link
Member

@333fred 333fred Nov 8, 2018

Choose a reason for hiding this comment

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

Nit: use the same end to the error message for both of these. #Closed

}
}
";
// https://github.com/dotnet/roslyn/issues/30362 how do we flag `await`?
Copy link
Member

@333fred 333fred Nov 8, 2018

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks
We'll have to follow-up with IOperation design team. IAwaitOperation is currently meant for expressions.
I'm not sure that we want to represent an await foreach ... as an IAwaitOperation containing an IForEachLoopOperation. It is a bit odd to apply IAwaitOperation to a statement and have it modify the semantics of that statement.
Rather, I expect we would have a new node (IAwaitForEachLoopOperation?), or maybe a flag on IForEachLoopOperation.


In reply to: 232009689 [](ancestors = 232009689)

VerifyFlowGraphAndDiagnosticsForTest<BlockSyntax>(source + s_IAsyncEnumerable + s_ValueTask, expectedFlowGraph, expectedDiagnostics);
}

private static string s_ValueTask = @"
Copy link
Member

@333fred 333fred Nov 8, 2018

Choose a reason for hiding this comment

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

Is this something we should consider putting in CSharpTestBase? #Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

I hesitate to do that because it is a non-functional implementation.


In reply to: 232010093 [](ancestors = 232010093)

@333fred
Copy link
Member

333fred commented Nov 8, 2018

Done review pass (commit 8) #Closed

@jcouv
Copy link
Member Author

jcouv commented Nov 9, 2018

test this please

@jcouv jcouv closed this Nov 9, 2018
@jcouv jcouv reopened this Nov 9, 2018
@jcouv
Copy link
Member Author

jcouv commented Nov 9, 2018

@333fred I addressed your feedback (either with a fix or a reply). Let me know if good with you now.

@jaredpar Please approve for preview2

@jcouv jcouv modified the milestones: 16.0, 16.0.P2 Nov 9, 2018
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 9)

@jaredpar
Copy link
Member

jaredpar commented Nov 9, 2018

approved

@jcouv jcouv merged commit d90b55e into dotnet:dev16.0-preview2 Nov 9, 2018
@jcouv jcouv deleted the async-blockers branch November 9, 2018 18:48
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
@agocke agocke mentioned this pull request Dec 5, 2018
10 tasks
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