-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Issue an error on cross-file merges we can't emit #38148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
weswigham
merged 1 commit into
microsoft:master
from
weswigham:js-declarations-crossfile-merge
Apr 24, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
17 changes: 17 additions & 0 deletions
17
tests/baselines/reference/jsDeclarationsCrossfileMerge.errors.txt
This file contains hidden or 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,17 @@ | ||
tests/cases/conformance/jsdoc/declarations/index.js(4,1): error TS6232: Declaration augments declaration in another file. This cannot be serialized. | ||
|
||
|
||
==== tests/cases/conformance/jsdoc/declarations/index.js (1 errors) ==== | ||
const m = require("./exporter"); | ||
|
||
module.exports = m.default; | ||
module.exports.memberName = "thing"; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS6232: Declaration augments declaration in another file. This cannot be serialized. | ||
!!! related TS6233 /.src/tests/cases/conformance/jsdoc/declarations/exporter.js:1:10: This is the declaration being augmented. Consider moving the augmenting declaration into the same file. | ||
|
||
==== tests/cases/conformance/jsdoc/declarations/exporter.js (0 errors) ==== | ||
function validate() {} | ||
|
||
export default validate; | ||
|
This file contains hidden or 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,28 @@ | ||
//// [tests/cases/conformance/jsdoc/declarations/jsDeclarationsCrossfileMerge.ts] //// | ||
|
||
//// [index.js] | ||
const m = require("./exporter"); | ||
|
||
module.exports = m.default; | ||
module.exports.memberName = "thing"; | ||
|
||
//// [exporter.js] | ||
function validate() {} | ||
|
||
export default validate; | ||
|
||
|
||
//// [exporter.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function validate() { } | ||
exports.default = validate; | ||
//// [index.js] | ||
var m = require("./exporter"); | ||
module.exports = m.default; | ||
module.exports.memberName = "thing"; | ||
|
||
|
||
//// [index.d.ts] | ||
declare const _exports: typeof import("./exporter").default; | ||
export = _exports; |
28 changes: 28 additions & 0 deletions
28
tests/baselines/reference/jsDeclarationsCrossfileMerge.symbols
This file contains hidden or 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,28 @@ | ||
=== tests/cases/conformance/jsdoc/declarations/index.js === | ||
const m = require("./exporter"); | ||
>m : Symbol(m, Decl(index.js, 0, 5)) | ||
>require : Symbol(require) | ||
>"./exporter" : Symbol("tests/cases/conformance/jsdoc/declarations/exporter", Decl(exporter.js, 0, 0)) | ||
|
||
module.exports = m.default; | ||
>module.exports : Symbol("tests/cases/conformance/jsdoc/declarations/index", Decl(index.js, 0, 0)) | ||
>module : Symbol(export=, Decl(index.js, 0, 32)) | ||
>exports : Symbol(export=, Decl(index.js, 0, 32)) | ||
>m.default : Symbol(default, Decl(exporter.js, 0, 22)) | ||
>m : Symbol(m, Decl(index.js, 0, 5)) | ||
>default : Symbol(default, Decl(exporter.js, 0, 22)) | ||
|
||
module.exports.memberName = "thing"; | ||
>module.exports.memberName : Symbol(memberName) | ||
>module.exports : Symbol(memberName, Decl(index.js, 2, 27)) | ||
>module : Symbol(module, Decl(index.js, 0, 32)) | ||
>exports : Symbol("tests/cases/conformance/jsdoc/declarations/index", Decl(index.js, 0, 0)) | ||
>memberName : Symbol(memberName, Decl(index.js, 2, 27)) | ||
|
||
=== tests/cases/conformance/jsdoc/declarations/exporter.js === | ||
function validate() {} | ||
>validate : Symbol(validate, Decl(exporter.js, 0, 0)) | ||
|
||
export default validate; | ||
>validate : Symbol(validate, Decl(exporter.js, 0, 0)) | ||
|
32 changes: 32 additions & 0 deletions
32
tests/baselines/reference/jsDeclarationsCrossfileMerge.types
This file contains hidden or 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,32 @@ | ||
=== tests/cases/conformance/jsdoc/declarations/index.js === | ||
const m = require("./exporter"); | ||
>m : typeof import("tests/cases/conformance/jsdoc/declarations/exporter") | ||
>require("./exporter") : typeof import("tests/cases/conformance/jsdoc/declarations/exporter") | ||
>require : any | ||
>"./exporter" : "./exporter" | ||
|
||
module.exports = m.default; | ||
>module.exports = m.default : typeof import("tests/cases/conformance/jsdoc/declarations/exporter").default | ||
>module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/exporter").default | ||
>module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/exporter").default; } | ||
>exports : typeof import("tests/cases/conformance/jsdoc/declarations/exporter").default | ||
>m.default : { (): void; memberName: string; } | ||
>m : typeof import("tests/cases/conformance/jsdoc/declarations/exporter") | ||
>default : { (): void; memberName: string; } | ||
|
||
module.exports.memberName = "thing"; | ||
>module.exports.memberName = "thing" : "thing" | ||
>module.exports.memberName : string | ||
>module.exports : typeof import("tests/cases/conformance/jsdoc/declarations/exporter").default | ||
>module : { "\"tests/cases/conformance/jsdoc/declarations/index\"": typeof import("tests/cases/conformance/jsdoc/declarations/exporter").default; } | ||
>exports : typeof import("tests/cases/conformance/jsdoc/declarations/exporter").default | ||
>memberName : string | ||
>"thing" : "thing" | ||
|
||
=== tests/cases/conformance/jsdoc/declarations/exporter.js === | ||
function validate() {} | ||
>validate : typeof validate | ||
|
||
export default validate; | ||
>validate : typeof validate | ||
|
16 changes: 16 additions & 0 deletions
16
tests/cases/conformance/jsdoc/declarations/jsDeclarationsCrossfileMerge.ts
This file contains hidden or 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 @@ | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @target: es5 | ||
// @lib: es6 | ||
// @outDir: ./out | ||
// @declaration: true | ||
// @filename: index.js | ||
const m = require("./exporter"); | ||
|
||
module.exports = m.default; | ||
module.exports.memberName = "thing"; | ||
|
||
// @filename: exporter.js | ||
function validate() {} | ||
|
||
export default validate; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is an impressive number of
?.
there