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 "Lock object" feature #71888

Closed
70 of 82 tasks
jjonescz opened this issue Jan 31, 2024 · 0 comments · Fixed by #74367
Closed
70 of 82 tasks

Test plan for "Lock object" feature #71888

jjonescz opened this issue Jan 31, 2024 · 0 comments · Fixed by #74367

Comments

@jjonescz
Copy link
Member

jjonescz commented Jan 31, 2024

Proposal: dotnet/csharplang#7104
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-13.0/lock-object.md
Runtime API proposal: dotnet/runtime#34812

  • -langversion check
  • lock (expr)
    • calls EnterLockScope
    • finally block calls Scope.Dispose
  • Monitor APIs used for converted Lock expression
  • warning for conversions
    • implicit/explicit conversion to base class
    • implicit/explicit conversion to derived class (add warning)
    • implicit/explicit conversion to interface
    • implicit/explicit conversion to dynamic
    • explicit conversion to Lock
    • implicit/explicit user-defined conversion (no warning)
    • implicit conversion from as
    • implicit conversion from best common type
  • use as argument to parameter of generic type (no warning)
  • Obsolete (no diagnostics)
  • async
    • with await in lock body
    • with no await in lock body
    • async local function
    • async lambda
  • iterators
    • with yield in lock body
    • with no yield in lock body
  • async iterator that returns IAsyncEnumerable
  • unexpected and missing members
    • Lock defined as struct
    • Lock defined as ref struct
    • Lock defined as interface
    • Scope defined as class
    • Scope defined as struct
    • EnterLockScope missing
    • Scope missing
    • Scope.Dispose missing
    • Lock inaccessible
    • Scope inaccessible
    • EnterLockScope inaccessible
    • Scope.Dispose inaccessible
    • Lock generic
    • Scope generic
    • EnterLockScope generic
    • Scope.Dispose generic
    • Scope not a member of Lock
    • EnterLockScope with parameters
    • EnterLockScope with optional or params parameters
    • EnterLockScope returns void
    • EnterLockScope returns type other than Scope
    • Scope.Dispose with parameters
    • Scope.Dispose with optional or params parameters
    • Scope.Dispose returns type
    • EnterLockScope is static
    • Scope.Dispose is static
    • EnterLockScope overloads
    • Scope.Dispose overloads
    • EnterLockScope defined on base class
    • Scope defined on base class
    • EnterLockScope as virtual, override, hidden
    • Scope.Dispose as virtual, override, hidden
    • EnterLockScope as explicit implementation
    • Scope.Dispose as explicit implementation
    • EnterLockScope use-site errors
    • Scope use-site errors
    • Scope.Dispose use-site errors
  • nullable analysis: within lock (expr) { } body, expr is treated as not null (not specific to Lock)
  • IOperation
  • ControlFlowGraph
    • with Lock members
    • missing Lock members
    • VB: with Lock members
    • VB: missing Lock members
  • SemanticModel: confirm SemanticModel does not expose specific locking APIs used
  • VB: error for use in SyncLock
  • VB: warning for conversions
    • implicit/explicit conversion to base class
    • implicit/explicit conversion to interface
    • explicit conversion to Lock
  • add to Compiler Test plan.md
  • EnC: verify Dispose() is invoked after editing lock body
  • Add VB test with Enter/Exit and Try/Finally when net9 is available. See Handle Lock type in VB #71927 (comment).
  • Check what the final API shape is (EnterLockScope name in particular) and rename if necessary.

Productivity

  • minbar (done)
  • fixer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants