-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
When I define a function with:
public [$$asyncIterator]() {
...
}
instead of
public [Symbol.asyncIterator]() {
...
}
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) {
~~
my tsconfig.json is:
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"noImplicitAny": false,
"rootDir": "./src",
"outDir": "./dist",
"pretty": true,
"removeComments": true,
"declaration": true,
"lib": ["esnext", "dom"]
},
"exclude": [
"node_modules",
"dist",
]
}
Metadata
Metadata
Assignees
Labels
No labels