Add test for catch variable explicitly typed as 'any'.

This commit is contained in:
Daniel Rosenwasser
2020-12-02 13:16:39 -08:00
parent 4c09bd3bbf
commit b47f01abb0

View File

@@ -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();
}