forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
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' of https://github.com/Microsoft/TypeScript into…
… anyFunctionTypeDontAddCandidate
- Loading branch information
Showing
34 changed files
with
913 additions
and
131 deletions.
There are no files selected for viewing
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
49 changes: 49 additions & 0 deletions
49
tests/baselines/reference/defaultExportsCannotMerge01.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,49 @@ | ||
tests/cases/conformance/es6/modules/m1.ts(2,25): error TS2651: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead. | ||
tests/cases/conformance/es6/modules/m1.ts(11,18): error TS2651: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead. | ||
tests/cases/conformance/es6/modules/m2.ts(5,8): error TS2304: Cannot find name 'Entity'. | ||
tests/cases/conformance/es6/modules/m2.ts(6,8): error TS2503: Cannot find namespace 'Entity'. | ||
tests/cases/conformance/es6/modules/m2.ts(8,8): error TS2339: Property 'x' does not exist on type '() => number'. | ||
tests/cases/conformance/es6/modules/m2.ts(9,8): error TS2339: Property 'y' does not exist on type '() => number'. | ||
|
||
|
||
==== tests/cases/conformance/es6/modules/m1.ts (2 errors) ==== | ||
|
||
export default function Decl() { | ||
~~~~ | ||
!!! error TS2651: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead. | ||
return 0; | ||
} | ||
|
||
export interface Decl { | ||
p1: number; | ||
p2: number; | ||
} | ||
|
||
export namespace Decl { | ||
~~~~ | ||
!!! error TS2651: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead. | ||
export var x = 10; | ||
export var y = 20; | ||
|
||
interface I { | ||
} | ||
} | ||
|
||
==== tests/cases/conformance/es6/modules/m2.ts (4 errors) ==== | ||
import Entity from "m1" | ||
|
||
Entity(); | ||
|
||
var x: Entity; | ||
~~~~~~ | ||
!!! error TS2304: Cannot find name 'Entity'. | ||
var y: Entity.I; | ||
~~~~~~ | ||
!!! error TS2503: Cannot find namespace 'Entity'. | ||
|
||
Entity.x; | ||
~ | ||
!!! error TS2339: Property 'x' does not exist on type '() => number'. | ||
Entity.y; | ||
~ | ||
!!! error TS2339: Property 'y' does not exist on type '() => number'. |
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,50 @@ | ||
//// [tests/cases/conformance/es6/modules/defaultExportsCannotMerge01.ts] //// | ||
|
||
//// [m1.ts] | ||
|
||
export default function Decl() { | ||
return 0; | ||
} | ||
|
||
export interface Decl { | ||
p1: number; | ||
p2: number; | ||
} | ||
|
||
export namespace Decl { | ||
export var x = 10; | ||
export var y = 20; | ||
|
||
interface I { | ||
} | ||
} | ||
|
||
//// [m2.ts] | ||
import Entity from "m1" | ||
|
||
Entity(); | ||
|
||
var x: Entity; | ||
var y: Entity.I; | ||
|
||
Entity.x; | ||
Entity.y; | ||
|
||
//// [m1.js] | ||
function Decl() { | ||
return 0; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = Decl; | ||
var Decl; | ||
(function (Decl) { | ||
Decl.x = 10; | ||
Decl.y = 20; | ||
})(Decl = exports.Decl || (exports.Decl = {})); | ||
//// [m2.js] | ||
var m1_1 = require("m1"); | ||
m1_1.default(); | ||
var x; | ||
var y; | ||
m1_1.default.x; | ||
m1_1.default.y; |
44 changes: 44 additions & 0 deletions
44
tests/baselines/reference/defaultExportsCannotMerge02.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,44 @@ | ||
tests/cases/conformance/es6/modules/m1.ts(2,22): error TS2651: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead. | ||
tests/cases/conformance/es6/modules/m1.ts(5,18): error TS2651: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead. | ||
tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typeof Decl' is not callable. Did you mean to include 'new'? | ||
tests/cases/conformance/es6/modules/m2.ts(6,8): error TS2503: Cannot find namespace 'Entity'. | ||
tests/cases/conformance/es6/modules/m2.ts(8,13): error TS2339: Property 'p1' does not exist on type 'Decl'. | ||
tests/cases/conformance/es6/modules/m2.ts(8,20): error TS2339: Property 'p2' does not exist on type 'Decl'. | ||
|
||
|
||
==== tests/cases/conformance/es6/modules/m1.ts (2 errors) ==== | ||
|
||
export default class Decl { | ||
~~~~ | ||
!!! error TS2651: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead. | ||
} | ||
|
||
export interface Decl { | ||
~~~~ | ||
!!! error TS2651: Merged declaration 'Decl' cannot include a default export declaration. Consider adding a separate 'export default Decl' declaration instead. | ||
p1: number; | ||
p2: number; | ||
} | ||
|
||
export namespace Decl { | ||
interface I { | ||
} | ||
} | ||
|
||
==== tests/cases/conformance/es6/modules/m2.ts (4 errors) ==== | ||
import Entity from "m1" | ||
|
||
Entity(); | ||
~~~~~~~~ | ||
!!! error TS2348: Value of type 'typeof Decl' is not callable. Did you mean to include 'new'? | ||
|
||
var x: Entity; | ||
var y: Entity.I; | ||
~~~~~~ | ||
!!! error TS2503: Cannot find namespace 'Entity'. | ||
var z = new Entity(); | ||
var sum = z.p1 + z.p2 | ||
~~ | ||
!!! error TS2339: Property 'p1' does not exist on type 'Decl'. | ||
~~ | ||
!!! error TS2339: Property 'p2' does not exist on type 'Decl'. |
Oops, something went wrong.