Promise returned from sync dispose
method should not be awaited when disposing an asyc-disposable
#58077
Labels
Milestone
π Search Terms
using
π Version & Regression Information
I assume it is in every version that
using
has been implementedβ― Playground Link
https://www.typescriptlang.org/play?ts=5.5.0-dev.20240404#code/BQQwzgngdgxgBMAlHAvAPjgbwFAwPZRgAucANngOapwDaAugNzbZxz6EkAOATngLYBLMAFMAIkM54R1KMIDucAAq9BI4MG7CweUgDdhAGjgB9ZOiwtWcEUQAqAvsLwBXIurMYcVq+QoA6TmcwAAtgACIIOAATCSlhOB5+IXiAIzwoiDDEJm9WTW09YSQcqwBfIwAGbMtS6ssvKxA5EAESIIEoKgAPagbvcGh4GgBlCD400j8B2HEwSWkUOFHxnT8AMzxucOWJqcgZ2JEsuiQLXJ9KAKDQsJ7pmFn51PTM6vPyy1ZSktYmlrawB0qJFFn0rCMxrsYnM4tQdqsNlswvDJtCnsdTmDvL4riFwpE0bC0hksj9cpoiM5uFAEipko84mSvgZPnBvjVmKwcYE8WFia8mJY-q1aUkRAyRILWOwCsI-L5gL5qrVikA
π» Code
π Actual behavior
It logs
["y dispose body", "y dispose promise body", "x asyncDispose body", "body"]
π Expected behavior
It should log
["y dispose body", "x asyncDispose body", "body", "y dispose promise body"]
.The "y dispose promise body" should be printed in the next event cycle, however it is printed before
x asyncDispose body
because the promise is awaited when disposingy
.Additional information about the issue
Per 7.5.6 GetDisposeMethod
cc @rbuckton
The text was updated successfully, but these errors were encountered: