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 default #19117

Closed
49 tasks
cston opened this issue Apr 28, 2017 · 1 comment
Closed
49 tasks

Test plan for default #19117

cston opened this issue Apr 28, 2017 · 1 comment

Comments

@cston
Copy link
Member

cston commented Apr 28, 2017

Test plan for default

Checklist for implementation of https://github.com/dotnet/csharplang/blob/master/proposals/target-typed-default.md

General concerns

  • Backward compatibility: report version error with earlier /langversion
  • Semantic model behavior
    • GetSymbolInfo
    • GetSpeculativeSymbolInfo
    • GetTypeInfo
    • GetSpeculativeTypeInfo
    • GetConstantValue
    • AnalyzeDataFlow
    • ClassifyConversion

Type and members

  • Attributes: positional and named parameters
  • Parameters:
    • Default parameter values: CancellationToken ct = default
    • params:
      • F(params T[] args): F(default) and F(null, default)
      • overload resolution with params and non-params, mixed value/reference types
  • Constant values
  • Enum (implicit and explicit underlying type)
  • Expression trees
  • Iterators: yield return default;
  • Initializers (object, collection, dictionary)
  • Array initializer
  • Expression-bodied methods/properties
  • String interpolation: $"{default}"
  • Dynamic: F(dynamic d): F(default)

Code

  • Statements:
    • if (default) { }
    • switch (default) { }
    • switch (e) { case default: }
    • switch (e1) { case e2 when (default): }
    • while (default) { }, do { } while (default)
    • for (; default; ) { }
    • foreach (... in default) { }
    • throw default;
    • return default;
    • try  { } catch (e) when (default) { }
    • lock (default) { }
    • using (default) { }
    • fixed (byte* p = default) { }
    • yield return default;
    • this = default; in struct .ctor
  • Expressions:
    • default.F
    • default()
    • default[i]
    • a[default]
    • nameof(default)
    • checked(default), unchecked(default), checked(default + x)
    • unary: op default
      • !default
    • binary: e op default, default op e
      • default == false
      • new S() == default for struct S with/without operator==, default has type S not S?
      • default + x with user-defined operator or conversion
    • default ? e1 : e2, e1 ? default : e2
    • default ?? e, e ?? default
    • (T)default
    • x op= default
      • x += default with user-defined operator or conversion
    • *default, &default, default->F
    • default is e, e is default
    • await default
    • __refvalue(default, T), _reftype(default), __makeref(default)
  • Lambdas: F(Func<T> f), F(Action a): F(() => default)
  • Target typing (var, lambdas, integrals)
  • Conversions
    • boxing/unboxing
    • DefaultOrNullLiteralConversion
  • Nullable (wrapping, unwrapping)
  • Anonymous types
  • Tuples
  • LINQ: select default
  • Ref return values
  • Overload resolution:
    • F(int i), F(string s): F(default)
    • F(Task<T> t), F(ValueTask<T> t): F(async () => default)
  • Type inference
  • WRN_IsAlwaysTrue, WRN_IsAlwaysFalse, WRN_AlwaysNull
  • __arglist: F(object o, __arglist): F(null, default)

IDE

Debugger / EE

  • Compiling expressions in Immediate/Watch windows or hovering over an expression
  • Compiling expressions in [DebuggerDisplay("...")]
  • Assigning values in Locals/Autos/Watch windows
@cston
Copy link
Member Author

cston commented Apr 28, 2017

See #18717

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants