File: propertyIdentityWithPrivacyMismatch.js

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 (49 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download
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
39
40
41
42
43
44
45
46
47
48
49
//// [tests/cases/compiler/propertyIdentityWithPrivacyMismatch.ts] ////

//// [propertyIdentityWithPrivacyMismatch_0.ts]
declare module 'mod1' {
    class Foo {
        private n;
    }
}
declare module 'mod2' {
    class Foo {
        private n;
    }
}

//// [propertyIdentityWithPrivacyMismatch_1.ts]
///<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)
class Foo1 {
    private n;
}
class Foo2 {
    private n;
}
var y: Foo1;
var y: Foo2;

//// [propertyIdentityWithPrivacyMismatch_0.js]
//// [propertyIdentityWithPrivacyMismatch_1.js]
define(["require", "exports"], function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var x;
    var x; // Should be error (mod1.Foo !== mod2.Foo)
    var Foo1 = /** @class */ (function () {
        function Foo1() {
        }
        return Foo1;
    }());
    var Foo2 = /** @class */ (function () {
        function Foo2() {
        }
        return Foo2;
    }());
    var y;
    var y;
});