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
TypeScript's type checking doesn't seem to understand that $$asyncIterator is equivalent to Symbol.asyncIterator. I get the following issue when I try to use a for await... of loop:
src/test/pulsar-client-test.ts:167:37 - error TS2504: Type 'PubSubAsyncIterator<{}>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.
167 for await (const message of ai) {
~~
Unfortunately this won't be possible until microsoft/TypeScript#27525 is solved. As mentioned there, we can reference custom symbols with typeof, but that doesn't work with well-known symbols such as Symbol.asyncIterator
When I define a function with:
instead of
TypeScript's type checking doesn't seem to understand that $$asyncIterator is equivalent to
Symbol.asyncIterator
. I get the following issue when I try to use a for await... of loop:my tsconfig.json is:
The text was updated successfully, but these errors were encountered: