roslyn: Quick Info shouldn't show oblivious parameters with null default values as 'not null'

Version used: 3.3.0-beta1-19360-03

The IDE shows the null state of this variable as not-null, which seems wrong. This code is in a #nullable disable context.

nullability-quick-info-2

A few thoughts:

  1. We could learn that this could be null by treating the default value as an assignment that might have occurred.
  2. We could stop showing the inferred nullability for oblivious variables, but it seems like users will lose out in other scenarios if we do this.
  3. We could decide that although this specific scenario looks weird, we’re okay with the current behavior in the #nullable disable context and just move on.

/cc @jasonmalinowski @333fred

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (20 by maintainers)

Commits related to this issue

Most upvoted comments

@jasonmalinowski we need to stop displaying flow state in disabled contexts.