Update the error messages as per PR feedback

This commit is contained in:
Sheetal Nandi 2015-10-30 11:56:44 -07:00
parent daba901619
commit 6ea74ae7f1
38 changed files with 80 additions and 80 deletions

View File

@ -2060,11 +2060,11 @@
"category": "Error",
"code": 5054
},
"Cannot write file '{0}' which is one of the input files.": {
"Cannot write file '{0}' because it would overwrite input file.": {
"category": "Error",
"code": 5055
},
"Cannot write file '{0}' since one or more input files would emit into it.": {
"Cannot write file '{0}' because it would be overwritten by multiple input files.": {
"category": "Error",
"code": 5056
},

View File

@ -1289,20 +1289,20 @@ namespace ts {
forEachKey(emitFilesSeen, emitFilePath => {
// Report error if the output overwrites input file
if (hasFile(files, emitFilePath)) {
createEmitBlockingDiagnostics(emitFilePath, Diagnostics.Cannot_write_file_0_which_is_one_of_the_input_files);
createEmitBlockingDiagnostics(emitFilePath, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file);
}
// Report error if multiple files write into same file (except if specified by --out or --outFile)
if (emitFilePath !== (options.outFile || options.out)) {
// Not --out or --outFile emit, There should be single file emitting to this file
if (emitFilesSeen[emitFilePath].length > 1) {
createEmitBlockingDiagnostics(emitFilePath, Diagnostics.Cannot_write_file_0_since_one_or_more_input_files_would_emit_into_it);
createEmitBlockingDiagnostics(emitFilePath, Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files);
}
}
else {
// --out or --outFile, error if there exist file emitting to single file colliding with --out
if (forEach(emitFilesSeen[emitFilePath], sourceFile => shouldEmitToOwnFile(sourceFile, options))) {
createEmitBlockingDiagnostics(emitFilePath, Diagnostics.Cannot_write_file_0_since_one_or_more_input_files_would_emit_into_it);
createEmitBlockingDiagnostics(emitFilePath, Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files);
}
}
});

View File

@ -1,6 +1,6 @@
EmitSkipped: true
Diagnostics:
Cannot write file 'tests/cases/fourslash/b.js' which is one of the input files.
Cannot write file 'tests/cases/fourslash/b.js' because it would overwrite input file.
EmitSkipped: false
FileName : tests/cases/fourslash/a.js

View File

@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'a.d.ts' which is one of the input files.
!!! error TS5055: Cannot write file 'a.d.ts' because it would overwrite input file.
==== tests/cases/compiler/a.d.ts (0 errors) ====
declare class c {

View File

@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'out.d.ts' which is one of the input files.
!!! error TS5055: Cannot write file 'out.d.ts' because it would overwrite input file.
==== tests/cases/compiler/out.d.ts (0 errors) ====
declare class c {

View File

@ -1,7 +1,7 @@
error TS5056: Cannot write file 'tests/cases/compiler/a.js' since one or more input files would emit into it.
error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' since one or more input files would emit into it.
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}

View File

@ -1,7 +1,7 @@
error TS5056: Cannot write file 'tests/cases/compiler/a.js' since one or more input files would emit into it.
error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' since one or more input files would emit into it.
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
==== tests/cases/compiler/a.ts (0 errors) ====
export class c {
}

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,1): error TS8009: 'declare' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
declare var v;
~~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,1): error TS8017: 'decorators' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
@internal class C { }
~~~~~~~~~

View File

@ -1,9 +1,9 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5056: Cannot write file 'tests/cases/compiler/a.js' since one or more input files would emit into it.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' since one or more input files would emit into it.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,6): error TS8015: 'enum declarations' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
enum E { }
~

View File

@ -1,9 +1,9 @@
error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
error TS5055: Cannot write file 'tests/cases/compiler/c.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
!!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,1): error TS8003: 'export=' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
export = b;
~~~~~~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,9): error TS8005: 'implements clauses' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
class C implements D { }
~~~~~~~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,1): error TS8002: 'import ... =' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
import a = b;
~~~~~~~~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,11): error TS8006: 'interface declarations' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
interface I { }
~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,8): error TS8007: 'module declarations' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
module M { }
~

View File

@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/c.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,13): error TS8009: '?' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
function F(p?) { }
~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,11): error TS8014: 'property declarations' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
class C { v }
~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(2,5): error TS8009: 'public' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
class C {
public foo() {

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,23): error TS8012: 'parameter modifiers' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
class C { constructor(public x) { }}
~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
function F(): number { }
~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(3,6): error TS1223: 'type' tag already specified.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
/**
* @type {number}

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,1): error TS8008: 'type aliases' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
type a = b;
~~~~~~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,5): error TS8011: 'type arguments' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
Foo<number>();
~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,10): error TS8016: 'type assertion expressions' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
var v = <string>undefined;
~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
function F(a: number) { }
~~~~~~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,9): error TS8004: 'type parameter declarations' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
class C<T> { }
~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,12): error TS8004: 'type parameter declarations' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
function F<T>() { }
~

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
tests/cases/compiler/a.js(1,8): error TS8010: 'types' can only be used in a .ts file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
==== tests/cases/compiler/a.js (1 errors) ====
var v: () => number;
~~~~~~~~~~~~

View File

@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'a.d.ts' which is one of the input files.
!!! error TS5055: Cannot write file 'a.d.ts' because it would overwrite input file.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}

View File

@ -1,9 +1,9 @@
error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
error TS5056: Cannot write file 'tests/cases/compiler/a.js' since one or more input files would emit into it.
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' which is one of the input files.
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' since one or more input files would emit into it.
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
!!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/b.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
!!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
==== tests/cases/compiler/a.ts (0 errors) ====

View File

@ -1,8 +1,8 @@
error TS5055: Cannot write file 'tests/cases/compiler/b.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
!!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'.
==== tests/cases/compiler/a.ts (0 errors) ====

View File

@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file.
!!! error TS5055: Cannot write file 'b.d.ts' which is one of the input files.
!!! error TS5055: Cannot write file 'b.d.ts' because it would overwrite input file.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}

View File

@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/b.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}

View File

@ -1,7 +1,7 @@
error TS5055: Cannot write file 'tests/cases/compiler/b.js' which is one of the input files.
error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' which is one of the input files.
!!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
}