Add tests for property access w/string index sigs

This commit is contained in:
Nathan Shively-Sanders
2016-12-05 09:58:09 -08:00
parent ca9f599563
commit a90d63a414
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
interface Flags { [name: string]: boolean };
let flags: Flags;
flags.b;
flags.f;
flags.isNotNecessarilyNeverFalse;
flags['this is fine'];
interface Empty { }
let empty: Empty;
empty.nope;
empty["that's ok"];

View File

@@ -0,0 +1,12 @@
// @noImplicitAny: true
interface Flags { [name: string]: boolean }
let flags: Flags;
flags.b;
flags.f;
flags.isNotNecessarilyNeverFalse;
flags['this is fine'];
interface Empty { }
let empty: Empty;
empty.nope;
empty["not allowed either"];