File: assigningFromObjectToAnythingElse.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (38 lines) | stat: -rw-r--r-- 2,265 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2322: Type 'Object' is not assignable to type 'RegExp'.
  The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
    Property 'exec' is missing in type 'Object'.
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,5): error TS2322: Type 'Object' is not assignable to type 'String'.
  The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
    Property 'charAt' is missing in type 'Object'.
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,5): error TS2322: Type 'Number' is not assignable to type 'String'.
  Property 'charAt' is missing in type 'Number'.
tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Type 'Object' is not assignable to type 'Error'.
  The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
    Property 'name' is missing in type 'Object'.


==== tests/cases/compiler/assigningFromObjectToAnythingElse.ts (4 errors) ====
    var x: Object;
    var y: RegExp;
    y = x;
    ~
!!! error TS2322: Type 'Object' is not assignable to type 'RegExp'.
!!! error TS2322:   The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
!!! error TS2322:     Property 'exec' is missing in type 'Object'.
    
    var a: String = Object.create<Object>("");
        ~
!!! error TS2322: Type 'Object' is not assignable to type 'String'.
!!! error TS2322:   The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
!!! error TS2322:     Property 'charAt' is missing in type 'Object'.
    var c: String = Object.create<Number>(1);
        ~
!!! error TS2322: Type 'Number' is not assignable to type 'String'.
!!! error TS2322:   Property 'charAt' is missing in type 'Number'.
    
    var w: Error = new Object();
        ~
!!! error TS2322: Type 'Object' is not assignable to type 'Error'.
!!! error TS2322:   The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?
!!! error TS2322:     Property 'name' is missing in type 'Object'.