mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 21:21:31 +03:00
12 lines
284 B
TypeScript
12 lines
284 B
TypeScript
|
|
class A<T1, T2> {
|
|
constructor(private map: (value: T1) => T2) {
|
|
|
|
}
|
|
}
|
|
|
|
class B extends A<number, string> {
|
|
// Ensure 'value' is of type 'number (and not '{}') by using its 'toExponential()' method.
|
|
constructor() { super(value => String(value.toExponential())); }
|
|
}
|