File: propertyIdentityWithPrivacyMismatch.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 (34 lines) | stat: -rw-r--r-- 1,417 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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(5,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type 'Foo', but here has type 'Foo'.
tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS2403: Subsequent variable declarations must have the same type.  Variable 'y' must be of type 'Foo1', but here has type 'Foo2'.


==== tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts (2 errors) ====
    ///<reference path='propertyIdentityWithPrivacyMismatch_0.ts'/>
    import m1 = require('mod1');
    import m2 = require('mod2');
    var x: m1.Foo;
    var x: m2.Foo; // Should be error (mod1.Foo !== mod2.Foo)
        ~
!!! error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type 'Foo', but here has type 'Foo'.
    class Foo1 {
        private n;
    }
    class Foo2 {
        private n;
    }
    var y: Foo1;
    var y: Foo2;
        ~
!!! error TS2403: Subsequent variable declarations must have the same type.  Variable 'y' must be of type 'Foo1', but here has type 'Foo2'.
==== tests/cases/compiler/propertyIdentityWithPrivacyMismatch_0.ts (0 errors) ====
    declare module 'mod1' {
        class Foo {
            private n;
        }
    }
    declare module 'mod2' {
        class Foo {
            private n;
        }
    }