Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No noUnusedLocals warning for recursive arrow function #57790

Closed
Profesor08 opened this issue Mar 15, 2024 · 1 comment
Closed

No noUnusedLocals warning for recursive arrow function #57790

Profesor08 opened this issue Mar 15, 2024 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@Profesor08
Copy link

πŸ”Ž Search Terms

typescript recursive arrow function warning

πŸ•— Version & Regression Information

Version 5.3.3

⏯ Playground Link

https://www.typescriptlang.org/play?noUncheckedIndexedAccess=true&useDefineForClassFields=true&allowUnreachableCode=true&allowUnusedLabels=true&downlevelIteration=true&noLib=true&noUnusedLocals=true&noUnusedParameters=true&experimentalDecorators=true&emitDecoratorMetadata=true&target=99&exactOptionalPropertyTypes=true&noFallthroughCasesInSwitch=true&noImplicitOverride=true&noPropertyAccessFromIndexSignature=true&isolatedModules=true&inlineSourceMap=false&inlineSources=false&allowSyntheticDefaultImports=true&useUnknownInCatchVariables=true&allowArbitraryExtensions=true&resolvePackageJsonImports=true&resolvePackageJsonExports=true&allowImportingTsExtensions=false&allowUmdGlobalAccess=false&suppressImplicitAnyIndexErrors=true&importHelpers=true#code/N4KABGDGD2B2DOAXMAzWBGMBeMAKAlAFxgBG00ANgKYCGs2AfGKBBAE5WICub9a6BANzgwAX2EiUXWJEQBLOKlgAmAsTKVa9Fqw7deS1fmERxISdNkK+sAMxrS5anWYj2nHvURsuVE2OFRECA

πŸ’» Code

{
  const fn1 = (): boolean => {
    return fn1();
  };

  function fn2(): boolean {
    return fn2();
  };

  function fn3(): boolean {
    return true;
  };
}

πŸ™ Actual behavior

fn1 has recursion, and this function is not used, but there is no warning. fn2, fn3 has warning.

πŸ™‚ Expected behavior

fn1, fn2, fn3 to have wanings

Additional information about the issue

No response

@MartinJohns
Copy link
Contributor

Duplicate of #45360. Used search terms: recursive unused in:title

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Mar 15, 2024
@RyanCavanaugh RyanCavanaugh closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants