diff --git a/tests/cases/compiler/useUnknownInCatchVariables01.ts b/tests/cases/compiler/useUnknownInCatchVariables01.ts index c9633c97e4f..ca9bdda4acb 100644 --- a/tests/cases/compiler/useUnknownInCatchVariables01.ts +++ b/tests/cases/compiler/useUnknownInCatchVariables01.ts @@ -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(); } \ No newline at end of file