TypeScript/tests/baselines/reference/specializedSignatureOverloadReturnTypeWithIndexers.errors.txt
2014-07-12 17:30:19 -07:00

19 lines
775 B
Plaintext

==== tests/cases/compiler/specializedSignatureOverloadReturnTypeWithIndexers.ts (1 errors) ====
interface A {
f(p: string): { [p: string]: string; };
f(p: "spec"): { [p: string]: any; } // Should be ok
}
interface B {
f(p: string): { [p: number]: string; };
f(p: "spec"): { [p: string]: any; } // Should be ok
}
interface C {
f(p: string): { [p: number]: string; };
f(p: "spec"): { [p: number]: any; } // Should be ok
}
interface D {
f(p: string): { [p: string]: string; };
f(p: "spec"): { [p: number]: any; } // Should be error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Specialized overload signature is not assignable to any non-specialized signature.
}