-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into constructorAccessibility
Conflicts: src/compiler/checker.ts
- Loading branch information
Showing
105 changed files
with
1,944 additions
and
1,016 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/declarationEmitIdentifierPredicates01.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//// [declarationEmitIdentifierPredicates01.ts] | ||
|
||
export function f(x: any): x is number { | ||
return typeof x === "number"; | ||
} | ||
|
||
//// [declarationEmitIdentifierPredicates01.js] | ||
"use strict"; | ||
function f(x) { | ||
return typeof x === "number"; | ||
} | ||
exports.f = f; | ||
|
||
|
||
//// [declarationEmitIdentifierPredicates01.d.ts] | ||
export declare function f(x: any): x is number; |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/declarationEmitIdentifierPredicates01.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
=== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitIdentifierPredicates01.ts === | ||
|
||
export function f(x: any): x is number { | ||
>f : Symbol(f, Decl(declarationEmitIdentifierPredicates01.ts, 0, 0)) | ||
>x : Symbol(x, Decl(declarationEmitIdentifierPredicates01.ts, 1, 18)) | ||
>x : Symbol(x, Decl(declarationEmitIdentifierPredicates01.ts, 1, 18)) | ||
|
||
return typeof x === "number"; | ||
>x : Symbol(x, Decl(declarationEmitIdentifierPredicates01.ts, 1, 18)) | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/declarationEmitIdentifierPredicates01.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
=== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitIdentifierPredicates01.ts === | ||
|
||
export function f(x: any): x is number { | ||
>f : (x: any) => x is number | ||
>x : any | ||
>x : any | ||
|
||
return typeof x === "number"; | ||
>typeof x === "number" : boolean | ||
>typeof x : string | ||
>x : any | ||
>"number" : string | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/baselines/reference/declarationEmitIdentifierPredicatesWithPrivateName01.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
tests/cases/conformance/declarationEmit/typePredicates/declarationEmitIdentifierPredicatesWithPrivateName01.ts(6,33): error TS4060: Return type of exported function has or is using private name 'I'. | ||
|
||
|
||
==== tests/cases/conformance/declarationEmit/typePredicates/declarationEmitIdentifierPredicatesWithPrivateName01.ts (1 errors) ==== | ||
|
||
interface I { | ||
a: number; | ||
} | ||
|
||
export function f(x: any): x is I { | ||
~ | ||
!!! error TS4060: Return type of exported function has or is using private name 'I'. | ||
return typeof x.a === "number"; | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/declarationEmitIdentifierPredicatesWithPrivateName01.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//// [declarationEmitIdentifierPredicatesWithPrivateName01.ts] | ||
|
||
interface I { | ||
a: number; | ||
} | ||
|
||
export function f(x: any): x is I { | ||
return typeof x.a === "number"; | ||
} | ||
|
||
//// [declarationEmitIdentifierPredicatesWithPrivateName01.js] | ||
"use strict"; | ||
function f(x) { | ||
return typeof x.a === "number"; | ||
} | ||
exports.f = f; |
43 changes: 43 additions & 0 deletions
43
tests/baselines/reference/declarationEmitThisPredicates01.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//// [declarationEmitThisPredicates01.ts] | ||
|
||
export class C { | ||
m(): this is D { | ||
return this instanceof D; | ||
} | ||
} | ||
|
||
export class D extends C { | ||
} | ||
|
||
//// [declarationEmitThisPredicates01.js] | ||
"use strict"; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var C = (function () { | ||
function C() { | ||
} | ||
C.prototype.m = function () { | ||
return this instanceof D; | ||
}; | ||
return C; | ||
}()); | ||
exports.C = C; | ||
var D = (function (_super) { | ||
__extends(D, _super); | ||
function D() { | ||
_super.apply(this, arguments); | ||
} | ||
return D; | ||
}(C)); | ||
exports.D = D; | ||
|
||
|
||
//// [declarationEmitThisPredicates01.d.ts] | ||
export declare class C { | ||
m(): this is D; | ||
} | ||
export declare class D extends C { | ||
} |
Oops, something went wrong.