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

valid: (value: string) => void but {valid(value) {} } error "Parameter 'value' implicitly has an 'any' type." #60058

Closed
yamiwamiyu opened this issue Sep 25, 2024 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@yamiwamiyu
Copy link

🔎 Search Terms

function inference any

🕗 Version & Regression Information

  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

https://www.typescriptlang.org/play/?noUncheckedIndexedAccess=true&useDefineForClassFields=true&allowUnreachableCode=true&allowUnusedLabels=true&downlevelIteration=true&noEmitHelpers=true&noStrictGenericChecks=true&noUnusedLocals=true&noUnusedParameters=true&preserveConstEnums=true&removeComments=true&importHelpers=true&experimentalDecorators=true&emitDecoratorMetadata=true&isolatedModules=true&isolatedDeclarations=false&allowUmdGlobalAccess=true&exactOptionalPropertyTypes=true&noFallthroughCasesInSwitch=true&noImplicitOverride=true&noPropertyAccessFromIndexSignature=true&useUnknownInCatchVariables=true&strictBuiltinIteratorReturn=true&noImplicitUseStrict=true&suppressImplicitAnyIndexErrors=true&preserveValueImports=true&keyofStringsOnly=true&suppressExcessPropertyErrors=true&noCheck=false&noErrorTruncation=true&preserveWatchOutput=true&verbatimModuleSyntax=true&allowSyntheticDefaultImports=true&allowArbitraryExtensions=true&noUncheckedSideEffectImports=true&resolvePackageJsonImports=true&resolvePackageJsonExports=true&allowImportingTsExtensions=true&disableSourceOfProjectReferenceRedirect=true&inlineSourceMap=true&inlineSources=true&stripInternal=true&pretty=true&ts=5.6.0-dev.20240818&ssl=140&ssc=43&pln=140&pc=61&noLib=true&filetype=ts#

💻 Code

// detail please see Playground Link
g<{
    ID?: number;
    Name?: string;
    Face?: string;
    Time?: Date;
}>().build({
    ID: {default: 10, },
    other: {init: '', default: 0, rules: [{valid(value) {} }]},
})

🙁 Actual behavior

Mouse over the valid to display valid: (value: string) => void
Mouse over the value to display Parameter 'value' implicitly has an 'any' type.

🙂 Expected behavior

value type is string not any

Additional information about the issue

No response

@MartinJohns
Copy link
Contributor

Duplicate of #47599.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Sep 25, 2024
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 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

4 participants