Intellisense show wrong properties for a Promise inside `async` method

Viewed 53

I've noticed that, when a Promise is used inside an async method, a lot of properties which should be in the IntelliSense are actually there.
Take this simple code for example (i'm using REACT and I'm inside a Hook component, just for give you a context).

const notAsyncMethod = () => {
    let a : Promise<string> = new Promise(null);
}

const asyncMethod = async () => {
    let a : Promise<string> = new Promise(null);
}

Now, in the first case, this is the IntelliSense suggestions: enter image description here

Which is exactly what I expect.

Then, in the second case, this is what IntelliSense suggests me: enter image description here

Why is this happening? Is it normal, or there might be some problem with my code? And, if this is how it should work.. Why is this happening, and from what those properties are coming?

0 Answers
Related