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

Missing warnings for nullable references under throw statement/expression #32877

Closed
TessenR opened this issue Jan 28, 2019 · 1 comment
Closed
Assignees
Labels
Area-Compilers Feature - Nullable Reference Types Nullable Reference Types Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented

Comments

@TessenR
Copy link

TessenR commented Jan 28, 2019

Version Used:
Microsoft Visual Studio Enterprise 2019 Preview
Version 16.0.0 Preview 2.0
VisualStudio.16.Preview/16.0.0-pre.2.0+28522.59
Microsoft .NET Framework
Version 4.7.03056

Steps to Reproduce:

Compile the following code:

#nullable enable
class C
{
  void M1() => throw null;
  void M2(System.Exception? ex = null) => throw ex;
}

Expected Behavior:
Nullable reference types warnings e.g. Possible dereference of a null reference for throw null and throw ex expressions.

Actual Behavior:
No warnings

@jcouv jcouv self-assigned this Jan 31, 2019
@jcouv jcouv added the 4 - In Review A fix for the issue is submitted for review. label Jan 31, 2019
@jcouv
Copy link
Member

jcouv commented Feb 13, 2019

Thanks for reporting this. Fixed in dev16.1 preview1 by #32991

@jcouv jcouv closed this as completed Feb 13, 2019
@jcouv jcouv added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Feature - Nullable Reference Types Nullable Reference Types Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

3 participants