You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectfileStreamLock=new();awaitSomeAsyncMethod();asyncTaskSomeAsyncMethod(){lock(fileStreamLock){usingFileStreamfs=new("test.txt",FileMode.OpenOrCreate);// Do something...}awaitTask.Yield();// For demonstration purposes}
RCS1261 is reported, saying that the FileStream can be disposed asynchronously, but doing so results in compiler error CS1996 (Cannot 'await' in the body of a 'lock' statement). This is not valid C#:
Product and Version Used:
Roslynator.Analyzers 4.9.0
Steps to Reproduce:
Consider the following code:
RCS1261
is reported, saying that theFileStream
can be disposed asynchronously, but doing so results in compiler error CS1996 (Cannot 'await' in the body of a 'lock' statement). This is not valid C#:The text was updated successfully, but these errors were encountered: