41 lines
774 B
Text
41 lines
774 B
Text
=== tests/cases/compiler/overloadOnConstConstraintChecks3.ts ===
|
|
class A { private x = 1}
|
|
>A : A
|
|
>x : number
|
|
>1 : number
|
|
|
|
class B extends A {}
|
|
>B : B
|
|
>A : A
|
|
|
|
class C extends A {
|
|
>C : C
|
|
>A : A
|
|
|
|
public foo() { }
|
|
>foo : () => void
|
|
}
|
|
function foo(name: 'hi'): B;
|
|
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
|
>name : 'hi'
|
|
>B : B
|
|
|
|
function foo(name: 'bye'): C;
|
|
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
|
>name : 'bye'
|
|
>C : C
|
|
|
|
function foo(name: string): A;
|
|
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
|
>name : string
|
|
>A : A
|
|
|
|
function foo(name: any): A {
|
|
>foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; }
|
|
>name : any
|
|
>A : A
|
|
|
|
return null;
|
|
>null : null
|
|
}
|
|
|