-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
as any
unexpectedly breaks function parameter type inference
#54987
Labels
Not a Defect
This behavior is one of several equally-correct options
Comments
RyanCavanaugh
added
the
Not a Defect
This behavior is one of several equally-correct options
label
Jul 12, 2023
Because defineConfig<any>(() => ({
target: "es5",
fileName: (format) => `index.${format === "es" ? "mjs" : "cjs"}`,
})); which displays the same behavior. |
Thank you so much for the explanation! I didn't realize the connection because the code came from a refactor of the function from non-generic to generic types 😂 |
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
🔎 Search Terms
as any
type casting
function parameter
generic type inference
🕗 Version & Regression Information
⏯ Playground Link
💻 Code
🙁 Actual behavior
The ones with an
as any
typecasts failed.🙂 Expected behavior
All
defineConfig
calls should pass.The text was updated successfully, but these errors were encountered: