Added scenario when duplicate function implementation is reported
This commit is contained in:
parent
d4d6e48ea5
commit
9f96f47a4f
6 changed files with 103 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation.
|
||||
|
||||
|
||||
==== tests/cases/compiler/b.js (0 errors) ====
|
||||
function foo() {
|
||||
return 10;
|
||||
}
|
||||
==== tests/cases/compiler/a.ts (1 errors) ====
|
||||
function foo() {
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
return 30;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
//// [tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementation.ts] ////
|
||||
|
||||
//// [b.js]
|
||||
function foo() {
|
||||
return 10;
|
||||
}
|
||||
//// [a.ts]
|
||||
function foo() {
|
||||
return 30;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// [out.js]
|
||||
function foo() {
|
||||
return 10;
|
||||
}
|
||||
function foo() {
|
||||
return 30;
|
||||
}
|
||||
|
||||
|
||||
//// [out.d.ts]
|
|
@ -0,0 +1,16 @@
|
|||
tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.ts (1 errors) ====
|
||||
function foo() {
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
return 30;
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/b.js (0 errors) ====
|
||||
function foo() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
//// [tests/cases/compiler/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts] ////
|
||||
|
||||
//// [a.ts]
|
||||
function foo() {
|
||||
return 30;
|
||||
}
|
||||
|
||||
//// [b.js]
|
||||
function foo() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// [out.js]
|
||||
function foo() {
|
||||
return 30;
|
||||
}
|
||||
function foo() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
|
||||
//// [out.d.ts]
|
|
@ -0,0 +1,12 @@
|
|||
// @jsExtensions: js
|
||||
// @out: out.js
|
||||
// @declaration: true
|
||||
// @filename: b.js
|
||||
function foo() {
|
||||
return 10;
|
||||
}
|
||||
// @filename: a.ts
|
||||
function foo() {
|
||||
return 30;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
// @jsExtensions: js
|
||||
// @out: out.js
|
||||
// @declaration: true
|
||||
// @filename: a.ts
|
||||
function foo() {
|
||||
return 30;
|
||||
}
|
||||
|
||||
// @filename: b.js
|
||||
function foo() {
|
||||
return 10;
|
||||
}
|
||||
|
Loading…
Reference in a new issue