We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
useUnknownInCatchVariables
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
promise promises catch method function any unknown useUnknownInCatchVariables
All versions with flag, like 4.5.0, including 4.6.0-nightly
async function veryverynice() { fetch('').catch(error => { console.log(error) }) try { await fetch('') } catch (error) { console.log(error) } }
4.6.0-nightly playground link with relevant code
async function veryverynice() { fetch('').catch(error => { // any console.log(error); }); try { await fetch('') } catch (error) { // unknown console.log(error); } }
error in promise.catch(error => {}) is of type any
error
promise.catch(error => {})
any
error in promise.catch(error => {}) is of type unknown
unknown
catch
The text was updated successfully, but these errors were encountered:
This is not a bug. The flag is not supposed to change the type of the catch method.
This was suggested as a feature request already: #45602. This was mentioned in the PR you linked.
Sorry, something went wrong.
This was suggested as a feature request already: #45602
I was literally writing a comment about that 😅 sorry for the duplicate
No branches or pull requests
Bug Report
🔎 Search Terms
promise promises catch method function any unknown useUnknownInCatchVariables
🕗 Version & Regression Information
All versions with flag, like 4.5.0, including 4.6.0-nightly
⏯ Playground Link
4.6.0-nightly playground link with relevant code
💻 Code
🙁 Actual behavior
error
inpromise.catch(error => {})
is of typeany
🙂 Expected behavior
error
inpromise.catch(error => {})
is of typeunknown
🍝 Related
catch
variables' default types tounknown
#41013The text was updated successfully, but these errors were encountered: