-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
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
-
-langversioncheck -
lock (expr)- calls
EnterLockScope -
finallyblock callsScope.Dispose
- calls
-
MonitorAPIs used for convertedLockexpression - 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
awaitinlockbody - with no
awaitinlockbody -
asynclocal function -
asynclambda
- with
- iterators
- with
yieldinlockbody - with no
yieldinlockbody
- with
-
asynciterator that returnsIAsyncEnumerable - unexpected and missing members
-
Lockdefined asstruct -
Lockdefined asref struct -
Lockdefined asinterface -
Scopedefined asclass -
Scopedefined asstruct -
EnterLockScopemissing -
Scopemissing -
Scope.Disposemissing -
Lockinaccessible -
Scopeinaccessible -
EnterLockScopeinaccessible -
Scope.Disposeinaccessible -
Lockgeneric -
Scopegeneric -
EnterLockScopegeneric -
Scope.Disposegeneric -
Scopenot a member ofLock -
EnterLockScopewith parameters -
EnterLockScopewith optional orparamsparameters -
EnterLockScopereturnsvoid -
EnterLockScopereturns type other thanScope -
Scope.Disposewith parameters -
Scope.Disposewith optional orparamsparameters -
Scope.Disposereturns type -
EnterLockScopeisstatic -
Scope.Disposeisstatic -
EnterLockScopeoverloads -
Scope.Disposeoverloads -
EnterLockScopedefined on base class -
Scopedefined on base class -
EnterLockScopeas virtual, override, hidden -
Scope.Disposeas virtual, override, hidden -
EnterLockScopeas explicit implementation -
Scope.Disposeas explicit implementation -
EnterLockScopeuse-site errors -
Scopeuse-site errors -
Scope.Disposeuse-site errors
-
- nullable analysis: within
lock (expr) { }body,expris treated as notnull(not specific toLock) - IOperation
- ControlFlowGraph
- with
Lockmembers - missing
Lockmembers - VB: with
Lockmembers - VB: missing
Lockmembers
- with
- 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 editinglockbody - Add VB test with
Enter/ExitandTry/Finallywhen net9 is available. See Handle Lock type in VB #71927 (comment). - Check what the final API shape is (
EnterLockScopename in particular) and rename if necessary.
Productivity
- minbar (done)
- fixer
Reactions are currently unavailable