mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Added scenario when duplicate function implementation is reported
This commit is contained in:
@@ -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]
|
||||
+16
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+24
@@ -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;
|
||||
}
|
||||
|
||||
+13
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user