You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of the latest nightly build (8/31/2015), the following code compiles:
interface Bob { [key: string]: any; }
var x: Bob = "something";
With TSC 1.5.3, I got the error message Index signature is missing in type 'String'. Can someone clarify if this is intended behavior? It seems like it might be (#4074), but it also seems a bit weird to be able to assign a string to what is probably intended to be a basic hash map.
The text was updated successfully, but these errors were encountered:
This is the intended behavior of #4074, the rationale being that any type meets the intended constraint (which basically is none). However, I agree we should probably consider disallowing primitive types since you can't actually add properties to those.
As of the latest nightly build (8/31/2015), the following code compiles:
With TSC 1.5.3, I got the error message
Index signature is missing in type 'String'.
Can someone clarify if this is intended behavior? It seems like it might be (#4074), but it also seems a bit weird to be able to assign a string to what is probably intended to be a basic hash map.The text was updated successfully, but these errors were encountered: