Skip to content

Conversation

@kevinsun-dev
Copy link
Contributor

In the process of updating features/param-nullchecking for updated specs (!!).

Changes:

  • Force merged master in (credit goes to @jaredpar)
  • Fixed several issues with param-nullchecking breaking async
  • Updated Tests

@kevinsun-dev kevinsun-dev changed the base branch from master to features/param-nullchecking July 28, 2020 22:17
{
_factory.CurrentFunction = node.Symbol;
var visited = (BoundLambda)base.VisitLambda(node);
var visited = (BoundLambda)base.VisitLambda(node)!;
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer a Debug.Assert(visited is object); instead of a suppression.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced the suppression with a Debug.Assert. An additional warning, but it should be fine. 👍

Copy link
Contributor Author

@kevinsun-dev kevinsun-dev Jul 29, 2020

Choose a reason for hiding this comment

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

Thought it was a warning, turns out it was an error:
LocalRewriter.cs(257,31): error CS8600: Converting null literal or possible null value to non-nullable type.
Reverted it back to what it was for now.

Copy link
Member

Choose a reason for hiding this comment

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

It is a warning locally but we push all warnings to errors in the CI runs.

Copy link
Member

Choose a reason for hiding this comment

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

The warning is because you need to cast it to BoundLambda?, not BoundLambda.

IL_000d: throw
IL_000e: ldc.i4.s -2
IL_0010: newobj ""C.<GetChars>d__0..ctor(int)""
IL_0000: ldc.i4.s -2
Copy link
Member

Choose a reason for hiding this comment

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

This reordering seems incorrect. I wouldn't necessarily try to fix it in this PR, just prototype it. But we should be doing the null checks first not after creating the enumerable closure object.

@kevinsun-dev kevinsun-dev marked this pull request as ready for review July 29, 2020 17:47
@kevinsun-dev kevinsun-dev requested a review from a team as a code owner July 29, 2020 17:47
@kevinsun-dev kevinsun-dev merged commit 3f382cb into dotnet:features/param-nullchecking Jul 31, 2020
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