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

Test plan for nullable annotations on unconstrained type parameters #44578

Closed
39 of 43 tasks
jcouv opened this issue May 26, 2020 · 0 comments
Closed
39 of 43 tasks

Test plan for nullable annotations on unconstrained type parameters #44578

jcouv opened this issue May 26, 2020 · 0 comments
Assignees
Labels
Area-Compilers Test Test failures in roslyn-CI
Milestone

Comments

@jcouv
Copy link
Member

jcouv commented May 26, 2020

See initial PR #45993

  • draft spec on dotnet/csharplang
  • language version errors for T? and where T : default
  • nullability of default(T) and default(T?)
  • nullability of var: var t = new T(); Local of unconstrained type parameter type is reported as NotAnnotated when using var #46236
  • nullability of (T?)t
  • nullability of (T)default(T)
  • interop with T from outside nullable context: see UnconstrainedTypeParameter_45, _46
  • T? outside nullable context
  • T? with no constraints, with class? constraint, with notnull constraint
  • T? as type argument
  • T? as constraint
  • T? substituted with U or U? where U : { T, T?, class, class?, struct, notnull }
  • T? in variance
  • T? in method type inference
  • T? in lambda return type inference
  • T? and T in best common type
  • T? in ref types
  • T? in out parameters: see UnconstrainedTypeParameter_47, No warning when overriding method with out T? rather than out T #49131
  • T? in ref parameters
  • T? in type argument constraint checks
  • T? with [AllowNull], [MaybeNull]: see UnconstrainedTypeParameter_16
  • T? with [DisallowNull], [NotNull]: see UnconstrainedTypeParameter_41, _42
  • non-safety warnings for assignment or explicit cast of T? to T No warning reported for assignment or explicit cast of possibly null value of unconstrained type parameter type #46044
  • conversions from U or U? to T or T? where U : { T, T? } No warning reported returning nullable version of unconstrained type parameter #46150
  • default constraint on method overrides and explicit implementations
  • default constraint on other methods
  • default constraint combined with other constraints
  • default constraint required to treat T? as unconstrained
  • overrides that differ by default and struct constraints
  • overrides that differ by default and other constraints { class, class?, notnull, I, I? }
  • overrides that differ by T and T?: see UnconstrainedTypeParameter_09, _10
  • T? consumed in C#8
  • T? consumed in C#8 with [AllowNull], [MaybeNull]
  • overrides and implementations with T? and [MaybeNull]T, etc.
  • symbol display of T? and IEnumerable<T?>
  • symbol display of method with where T : default constraint
  • unassigned fields of type T and T?
  • annotations from GetDeclaredSymbol()
  • flow state from GetSymbolInfo() on a method re-inferred with T?
  • flow state from IOperation on a method re-inferred with T?

Productivity:

  • check publicAPI analyzer on T?
  • recommend default keyword
  • UseExplicitType
@jcouv jcouv added this to the Compiler.Net5 milestone May 26, 2020
@jaredpar jaredpar modified the milestones: Compiler.Net5, 16.8 Jun 23, 2020
@cston cston changed the title Test plan for "maybe default" (T??) Test plan for nullable annotations on unconstrained type parameters Jul 21, 2020
@jaredpar jaredpar added Test Test failures in roslyn-CI and removed Feature Request labels Aug 4, 2020
@cston cston closed this as completed Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Test Test failures in roslyn-CI
Projects
None yet
Development

No branches or pull requests

3 participants