Problem
This is because the compiler still allows implicit types anythat can occur when accessing an object property using an index:
let dictionary: { [index: number]: string };
let myStringTypedVar = dictionary[5];
let myAnyTypedVar = dictionary["prop"];
let myNumberTypedVar = 5;
let myAnyTypedVar = myNumberTypedVar["prop"];
Fix: compile with --noImplictAny
If you compile your example with --noImplictAny, then this will be an error:
tsc --noImplicitAny example.ts
Outputs:
example.ts (8,9): error TS7017: the signature of an object type index is implicitly of type "any".
--noImplicitAny. Visual Studio --noImplictAny, " " "" "typescript :

"noImplicitAny": "true" compilerOptions tsconfig.json.