xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

TypeScript fix duplicate function implementation error

TypeScript fix duplicate function implementation error

TypeScript 如何去掉方法实现重复的错误提示 ✅

error

//1.ts File
function test(){
    console.log("File 1 Error");
}
//2.ts File
function test(){
    console.log("File 2 Error");
}

soultion

// 1.ts file

export {};

function test(){
    console.log("File 1 Error");
}

// 2.ts file

export {};

function test(){
    console.log("File 2 Error");
}


???

// 1.ts file

function test(){
    console.log("File 1 Error");
}

export {};

// 2.ts file

function test(){
    console.log("File 2 Error");
}

export {};

refs

https://github.com/microsoft/TypeScript/issues/24925

https://stackoverflow.com/questions/40900791/cannot-redeclare-block-scoped-variable-in-unrelated-files



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-05-04 12:25  xgqfrms  阅读(444)  评论(3编辑  收藏  举报