-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" instead
Description
It seems the index constraint doesn't seem to constrain anymore... if it does, then I blame it being early in the morning.
Copying the code from Ryan's post here:
class Customer {
dummyProperty: string;
}
var map: { [email: string]: Customer; } = { };
map['foo@gmail.com'] = new Customer(); // OK
map[14] = new Customer(); // Not OK, 14 is not a string -- ACTUALLY, this compiles now
map['bar@hotmail.com'] = 'x'; // Not OK, x is not a customer
Apologies if this has already been raised, but I couldn't find a duplicate issue. Maybe this is now by design?
zjiekai
Metadata
Metadata
Assignees
Labels
By DesignDeprecated - use "Working as Intended" or "Design Limitation" insteadDeprecated - use "Working as Intended" or "Design Limitation" instead