23 lines
323 B
TypeScript
23 lines
323 B
TypeScript
function f0<T extends typeof a>(a: T) {
|
|
a.b;
|
|
}
|
|
|
|
function f1<T extends typeof a>({a}: {a:T}) {
|
|
a.b;
|
|
}
|
|
|
|
function f2<T extends typeof a>([a]: T[]) {
|
|
a.b;
|
|
}
|
|
|
|
class A {
|
|
m0<T extends typeof a>(a: T) {
|
|
a.b
|
|
}
|
|
m1<T extends typeof a>({a}: {a:T}) {
|
|
a.b
|
|
}
|
|
m2<T extends typeof a>([a]: T[]) {
|
|
a.b
|
|
}
|
|
} |