Skip to content

🐛 Bug: symbolHasReadonlyDeclaration doesn't support const type parameters #518

@RebeccaStevens

Description

@RebeccaStevens

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

For code like the following: playground link

declare const fn: <const A>(param: A) => A;
const test = fn({ foo: { bar: 1 } });
//    ^? const test: { readonly foo: { readonly bar: 1; }; }

The object literal passed to fn should essentially be treated the same as if it was appended with as const and thus symbolHasReadonlyDeclaration should return true for the symbol of each of its deep properties.

Actual

symbolHasReadonlyDeclaration returns false for those symbols.

Additional Info

release notes: const Type Parameters
Initial issue: eslint-functional/eslint-plugin-functional#827

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: accepting prsPlease, send a pull request to resolve this! 🙏type: bugSomething isn't working 🐛

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions