我不明白为什么需要打字原稿明确泛型类型定义为Child2和Child3在这种情况下: abstract class Base {
public static A: string = "Fallback_A";
public DoSmthWithClassName(): string {
return "Fallback_DoSmth";
}
c
我有以下的一般类的打字稿 type UserId = number
type Primative = string | number | boolean
class ColumnValue<T, S extends Primative> {
constructor(public columnName: String, public value: S) { }
}
abstract
我认为这是一个正确实现泛型的问题,但我不确定。 我创建代表这里的问题Github的要点是: https://gist.github.com/ORESoftware/66b72b4b85262d957cb03ad097e4743e 说我有这个超: class A {
foo(): A {
return this;
}
}
和几个子类,一个例子看起来像