From cf1bceb9e4a90b2425ff46fee3a9b01c7fbb7c60 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 30 May 2019 17:35:10 -0700 Subject: [PATCH] Add tests --- tests/cases/compiler/implicitIndexSignatures.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/cases/compiler/implicitIndexSignatures.ts b/tests/cases/compiler/implicitIndexSignatures.ts index 2e36a91bada..2239ad8a8e2 100644 --- a/tests/cases/compiler/implicitIndexSignatures.ts +++ b/tests/cases/compiler/implicitIndexSignatures.ts @@ -43,3 +43,15 @@ function f4() { const v3 = getNumberIndexValue(o1); const v4 = getNumberIndexValue(o2); } + +function f5() { + enum E1 { A, B } + enum E2 { A = "A", B = "B" } + enum E3 { A = 0, B = "B" } + const v1 = getStringIndexValue(E1); + const v2 = getStringIndexValue(E2); + const v3 = getStringIndexValue(E3); + const v4 = getNumberIndexValue(E1); + const v5 = getNumberIndexValue(E2); + const v6 = getNumberIndexValue(E3); +}