File: overloadOnConstantsInvalidOverload1.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 203,960 kB
  • sloc: sh: 11; makefile: 5
file content (20 lines) | stat: -rw-r--r-- 912 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(6,10): error TS2394: Overload signature is not compatible with function implementation.
tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts(11,5): error TS2345: Argument of type '"HI"' is not assignable to parameter of type '"SPAN"'.


==== tests/cases/compiler/overloadOnConstantsInvalidOverload1.ts (2 errors) ====
    class Base { foo() { } }
    class Derived1 extends Base { bar() { } }
    class Derived2 extends Base { baz() { } }
    class Derived3 extends Base { biz() { } }
    
    function foo(name: "SPAN"): Derived1;
             ~~~
!!! error TS2394: Overload signature is not compatible with function implementation.
    function foo(name: "DIV"): Derived2 {
        return null;
    }
    
    foo("HI");
        ~~~~
!!! error TS2345: Argument of type '"HI"' is not assignable to parameter of type '"SPAN"'.