interface IdxSig { [ key ] : string ; } function propAccess ( x ) { x . prop ; x [ 'prop' ] ; } function descructuring ( x ) { const { prop } = x ; } interface MixedIdxSig extends IdxSig { namedProp : string ; } function mixedPropAccess ( x ) { x . namedProp ; x [ 'namedProp' ] ; x . prop ; x [ 'prop' ] ; } function genericAccess < T extends IdxSig > ( x ) { x . prop ; x [ 'prop' ] ; } interface MixedIndexSigUsedInUnion { [ key ] : string ; namedProp2 : string ; } function unionType ( x ) { x . prop ; x [ 'prop' ] ; } /**
 * Curiously Record<string, T> is treated like an index signature.
 */ function recordStringType ( x ) { x . prop ; x [ 'prop' ] ; } /**
 * But narrowing the generic parameter to a string literal union exempts it.
 */ function recordNarrowType ( x ) { x . prop ; x [ 'prop' ] ; } /**
 * Similary, to Records mapped types of of 'in string' are threated like a
 * string index signature.
 */ function mappedType ( x ) { x . prop ; x [ 'prop' ] ; }