-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Regression: incorrect return type when disabled strictNullChecks #60187
Copy link
Copy link
Open
Labels
Domain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
Metadata
Metadata
Assignees
Labels
Domain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
🔎 Search Terms
"ts7011", "strictnullchecks"
🕗 Version & Regression Information
When disabled
strictNullChecksintsconfig.jsonerrorTS7011: Function expression, which lacks return-type annotation, implicitly has an T return type⏯ Playground Link
https://www.typescriptlang.org/play/?strict=false&strictNullChecks=false&alwaysStrict=false&noEmitHelpers=true&noUnusedLocals=true&esModuleInterop=false&declaration=false&importHelpers=true&experimentalDecorators=true&target=6&module=6&suppressImplicitAnyIndexErrors=true&strictBuiltinIteratorReturn=true&ts=5.7.0-dev.20241010#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXwHcsJgxZgAVHAJRAHMBRADwAcAKAZwC54OMYsqOgEoetRq3gAfeKmQQIAbgBQYPH3gx5IDvAC88ANoByKMYA08YwCNjAXQB0iaBgCyUdlogI9APkLEpORU4sye2sLSMoZ2wopAA
💻 Code
🙁 Actual behavior
TS7011: Function expression, which lacks return-type annotation, implicitly has an 'RegExp | any[]' return type.
🙂 Expected behavior
No error
Additional information about the issue
No response