mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add test for catch variable explicitly typed as 'any'.
This commit is contained in:
@@ -18,6 +18,18 @@ catch (e) {
|
||||
e.stack?.toUpperCase();
|
||||
}
|
||||
if (typeof e === "number") {
|
||||
e.toExponential();
|
||||
e++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// ...
|
||||
}
|
||||
catch (e: any) {
|
||||
// All are allowed.
|
||||
void e.toUpperCase();
|
||||
void e.toExponential();
|
||||
void e();
|
||||
}
|
||||
Reference in New Issue
Block a user