-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClassLike can not extend nested entity #296
Labels
import-qualifiers
anything related to JsQualifier, JsModule, JsNonModule annotations and similar constructs
kotlin-design
limitations due to the design of kotlin language
Milestone
Comments
Schahen
added
kotlin-design
limitations due to the design of kotlin language
import-qualifiers
anything related to JsQualifier, JsModule, JsNonModule annotations and similar constructs
labels
May 29, 2020
Here's how underlying javascript structure supposed to look like: class Ping {
ping() {
console.log("PING");
}
}
class Pong {
pong() {
console.log("PONG");
}
}
Ping.Pong = Pong;
exports.Ping = Ping; |
Funny thing is that I don't know how to mimic exactly this in ts, I know how to do this: export declare class Ping implements Ping.Pong {
ping();
pong();
}
declare namespace Ping {
interface Pong {
pong();
}
} but this won't if Ping would have been a class |
Here's more "pure" js example of such declaration function Ping() { }
Ping.Pong = function() { }
Ping.prototype = new Ping.Pong();
Ping.prototype.ping = function() {
console.log("ping!!!");
}
Ping.Pong.prototype.pong = function() {
console.log("pong!!!");
}
exports.Ping = Ping; |
Minimal typescript example: export declare class Ping implements Ping.Pong {
ping();
pong();
}
declare namespace Ping {
interface Pong {
pong();
}
} |
Schahen
added a commit
that referenced
this issue
Aug 19, 2020
I can see a lot of room for improvement but well, know we are resolving this particular situation, so I'm closing this one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
import-qualifiers
anything related to JsQualifier, JsModule, JsNonModule annotations and similar constructs
kotlin-design
limitations due to the design of kotlin language
I was 100% sure that this issue exist however I'm failing to find it, to lost it is worser than to have a duplicate, so, here's a minimal breaking example:
which is translated to:
This seemingly harmless snippet of code is actually illegal in Kotlin since we can no inherit from nested entities.
Luckily, the workaround exists and it's as easy as just move Inspection out of parent class and us JsQualifier annotation if needed.
The text was updated successfully, but these errors were encountered: