Microsoft/TypeScript
Vedi su GitHubNo duplicate identifier error issued if `const` declared with function type with expandos
Open
#57.985 aperta il 28 mar 2024
BugDomain: BinderHelp Wanted
Metriche repository
- Star
- (48.455 star)
- Metriche merge PR
- (Merge medio 6g 17h) (9 PR mergiate in 30 g)
Descrizione
🔎 Search Terms
To be updated
🕗 Version & Regression Information
See playground link
⏯ Playground Link
💻 Code
interface Describable {
(s: string): boolean;
desc: string;
}
// let f: Describable = (s: string) => true;
const f: Describable = (s: string) => true;
console.log(f.desc);
f.desc = f.desc + '...more';
console.log(f.desc);
const f = 2;
let f = 3;
var f = '32e32';
"use strict";
// let f: Describable = (s: string) => true;
const f = (s) => true;
console.log(f.desc);
f.desc = f.desc + '...more';
console.log(f.desc);
const f = 2;
let f = 3;
var f = '32e32';
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"strictBindCallApply": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"alwaysStrict": true,
"esModuleInterop": true,
"declaration": true,
"target": "ES2017",
"jsx": "react",
"module": "ESNext",
"moduleResolution": "node"
}
}
Playground Link: Provided
🙁 Actual behavior
No errors
🙂 Expected behavior
Errors
Additional information about the issue
Also try with let by commenting line 7 and uncommenting line 6