mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 16:34:36 -05:00
Add tests for property access w/string index sigs
This commit is contained in:
@@ -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"];
|
||||
@@ -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"];
|
||||
Reference in New Issue
Block a user