File: typeCheckingInsideFunctionExpressionInArray.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (22 lines) | stat: -rw-r--r-- 1,140 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(2,7): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(3,5): error TS2322: Type 'Object' is not assignable to type 'string'.
tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(4,15): error TS2339: Property 'NonexistantMethod' does not exist on type 'number[]'.
tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts(5,5): error TS2304: Cannot find name 'derp'.


==== tests/cases/compiler/typeCheckingInsideFunctionExpressionInArray.ts (4 errors) ====
    var functions = [function () {
      var k: string = 10;
          ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
        k = new Object();
        ~
!!! error TS2322: Type 'Object' is not assignable to type 'string'.
        [1, 2, 3].NonexistantMethod();
                  ~~~~~~~~~~~~~~~~~
!!! error TS2339: Property 'NonexistantMethod' does not exist on type 'number[]'.
        derp();
        ~~~~
!!! error TS2304: Cannot find name 'derp'.
    }];