mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #6738 from Microsoft/port-6736
ports #6736 into release-1.8
This commit is contained in:
@@ -8741,7 +8741,7 @@ namespace ts {
|
||||
*/
|
||||
function checkClassPropertyAccess(node: PropertyAccessExpression | QualifiedName, left: Expression | QualifiedName, type: Type, prop: Symbol): boolean {
|
||||
const flags = getDeclarationFlagsFromSymbol(prop);
|
||||
const declaringClass = <InterfaceType>getDeclaredTypeOfSymbol(prop.parent);
|
||||
const declaringClass = <InterfaceType>getDeclaredTypeOfSymbol(getMergedSymbol(prop.parent));
|
||||
|
||||
if (left.kind === SyntaxKind.SuperKeyword) {
|
||||
const errorNode = node.kind === SyntaxKind.PropertyAccessExpression ?
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
//// [tests/cases/compiler/declarationMerging1.ts] ////
|
||||
|
||||
//// [file1.ts]
|
||||
class A {
|
||||
protected _f: number;
|
||||
getF() { return this._f; }
|
||||
}
|
||||
|
||||
//// [file2.ts]
|
||||
interface A {
|
||||
run();
|
||||
}
|
||||
|
||||
//// [file1.js]
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.prototype.getF = function () { return this._f; };
|
||||
return A;
|
||||
}());
|
||||
//// [file2.js]
|
||||
@@ -0,0 +1,21 @@
|
||||
=== tests/cases/compiler/file1.ts ===
|
||||
class A {
|
||||
>A : Symbol(A, Decl(file1.ts, 0, 0), Decl(file2.ts, 0, 0))
|
||||
|
||||
protected _f: number;
|
||||
>_f : Symbol(_f, Decl(file1.ts, 0, 9))
|
||||
|
||||
getF() { return this._f; }
|
||||
>getF : Symbol(getF, Decl(file1.ts, 1, 25))
|
||||
>this._f : Symbol(_f, Decl(file1.ts, 0, 9))
|
||||
>this : Symbol(A, Decl(file1.ts, 0, 0), Decl(file2.ts, 0, 0))
|
||||
>_f : Symbol(_f, Decl(file1.ts, 0, 9))
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/file2.ts ===
|
||||
interface A {
|
||||
>A : Symbol(A, Decl(file1.ts, 0, 0), Decl(file2.ts, 0, 0))
|
||||
|
||||
run();
|
||||
>run : Symbol(run, Decl(file2.ts, 0, 13))
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
=== tests/cases/compiler/file1.ts ===
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
protected _f: number;
|
||||
>_f : number
|
||||
|
||||
getF() { return this._f; }
|
||||
>getF : () => number
|
||||
>this._f : number
|
||||
>this : this
|
||||
>_f : number
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/file2.ts ===
|
||||
interface A {
|
||||
>A : A
|
||||
|
||||
run();
|
||||
>run : () => any
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
//// [tests/cases/compiler/declarationMerging2.ts] ////
|
||||
|
||||
//// [a.ts]
|
||||
|
||||
export class A {
|
||||
protected _f: number;
|
||||
getF() { return this._f; }
|
||||
}
|
||||
|
||||
//// [b.ts]
|
||||
export {}
|
||||
declare module "./a" {
|
||||
interface A {
|
||||
run();
|
||||
}
|
||||
}
|
||||
|
||||
//// [a.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.prototype.getF = function () { return this._f; };
|
||||
return A;
|
||||
}());
|
||||
exports.A = A;
|
||||
});
|
||||
//// [b.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/compiler/a.ts ===
|
||||
|
||||
export class A {
|
||||
>A : Symbol(A, Decl(a.ts, 0, 0), Decl(b.ts, 1, 22))
|
||||
|
||||
protected _f: number;
|
||||
>_f : Symbol(_f, Decl(a.ts, 1, 16))
|
||||
|
||||
getF() { return this._f; }
|
||||
>getF : Symbol(getF, Decl(a.ts, 2, 25))
|
||||
>this._f : Symbol(_f, Decl(a.ts, 1, 16))
|
||||
>this : Symbol(A, Decl(a.ts, 0, 0), Decl(b.ts, 1, 22))
|
||||
>_f : Symbol(_f, Decl(a.ts, 1, 16))
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
export {}
|
||||
declare module "./a" {
|
||||
interface A {
|
||||
>A : Symbol(A, Decl(a.ts, 0, 0), Decl(b.ts, 1, 22))
|
||||
|
||||
run();
|
||||
>run : Symbol(run, Decl(b.ts, 2, 17))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/compiler/a.ts ===
|
||||
|
||||
export class A {
|
||||
>A : A
|
||||
|
||||
protected _f: number;
|
||||
>_f : number
|
||||
|
||||
getF() { return this._f; }
|
||||
>getF : () => number
|
||||
>this._f : number
|
||||
>this : this
|
||||
>_f : number
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/b.ts ===
|
||||
export {}
|
||||
declare module "./a" {
|
||||
interface A {
|
||||
>A : A
|
||||
|
||||
run();
|
||||
>run : () => any
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// @filename: file1.ts
|
||||
class A {
|
||||
protected _f: number;
|
||||
getF() { return this._f; }
|
||||
}
|
||||
|
||||
// @filename: file2.ts
|
||||
interface A {
|
||||
run();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// @module: amd
|
||||
|
||||
// @filename: a.ts
|
||||
export class A {
|
||||
protected _f: number;
|
||||
getF() { return this._f; }
|
||||
}
|
||||
|
||||
// @filename: b.ts
|
||||
export {}
|
||||
declare module "./a" {
|
||||
interface A {
|
||||
run();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user