-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed as not planned
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
For the situations where the sub-class should return itself in the callback, it generates the wrong type.
It also generates a duplicate definition.
class Test {
static Builder = class {
static Create() {
return new this();
}
PrintHello() {
return this;
}
PrintGoodbye() {
return this;
}
GetNumber() {
return 5;
}
};
Method1(){
console.log("1");
return this
}
}
expected behaviour
generates .d.ts like/ or something like
declare class Anonymous1 {
static Create(): Anonymous1
PrintHello(): this;
PrintGoodbye(): this;
GetNumber(): number;
}
declare class Test {
static Builder: Anonymous1;
Method1(): this;
}
got
declare class Test {
static Builder: {
new (): {
PrintHello(): any;
PrintGoodbye(): any;
GetNumber(): number;
};
Create(): {
PrintHello(): any;
PrintGoodbye(): any;
GetNumber(): number;
};
};
Method1(): this;
}
Some of the tooling relies on the type generation e.g. roblox-ts
and it causes some problems with the package Intellisense because any
cannot be used for the generation of code like luau
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created