Is there a way to ignore `JS_NAME_CLASH` errors? I...
# javascript
e
Is there a way to ignore
JS_NAME_CLASH
errors? I really want the method to be overridden no matter what.
This is the error.
Seems
@Suppress("JS_NAME_CLASH")
is enough. But is it supposed to work?
t
Do you really need custom promise declaration?
e
@turansky it seems IJ doesn't always recognize thenable objects, so type inference in the IDE when using
await
is not always great. If instead I extend Promise, the IDE works nicely.
t
Shift + Double space works fine
e
In TS, try creating a class with a
then
method (accepting a lambda as
string => number
).
then(fn: ((s: string) => number)): MyClass
Then await on its instance:
Copy code
const o = new MyClass();
const r = await o;
console.log(r);
Now use CTRL SHIFT P to get the quick type of r, it should be incorrect
Wrote on the phone, I'll post a better example later, taken from my own code