mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
do not crash when variable and function declarations collide
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
tests/cases/compiler/nonMergedOverloads.ts(1,5): error TS2300: Duplicate identifier 'f'.
|
||||
tests/cases/compiler/nonMergedOverloads.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided.
|
||||
tests/cases/compiler/nonMergedOverloads.ts(3,17): error TS2300: Duplicate identifier 'f'.
|
||||
tests/cases/compiler/nonMergedOverloads.ts(4,17): error TS2300: Duplicate identifier 'f'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/nonMergedOverloads.ts (4 errors) ====
|
||||
var f = 10;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
|
||||
export function f();
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
export function f() {
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
//// [nonMergedOverloads.ts]
|
||||
var f = 10;
|
||||
|
||||
export function f();
|
||||
export function f() {
|
||||
}
|
||||
|
||||
//// [nonMergedOverloads.js]
|
||||
var f = 10;
|
||||
function f() {
|
||||
}
|
||||
exports.f = f;
|
||||
@@ -0,0 +1,5 @@
|
||||
var f = 10;
|
||||
|
||||
export function f();
|
||||
export function f() {
|
||||
}
|
||||
Reference in New Issue
Block a user