Revert "Make 'keyof readonly T' be the same as 'keyof T'"

This reverts commit 97fb23b519.
This commit is contained in:
Anders Hejlsberg
2017-08-02 15:32:03 -07:00
parent 97fb23b519
commit 0f0fbce178
-3
View File
@@ -7530,9 +7530,6 @@ namespace ts {
}
function getIndexType(type: Type): Type {
if (type.flags & TypeFlags.Readonly || getObjectFlags(type) & ObjectFlags.Readonly) {
type = (<ReadonlyTypeVariable | ReadonlyObjectType>type).type;
}
return maybeTypeOfKind(type, TypeFlags.TypeVariable) ? getIndexTypeForGenericType(<TypeVariable | UnionOrIntersectionType>type) :
getObjectFlags(type) & ObjectFlags.Mapped ? getConstraintTypeFromMappedType(<MappedType>type) :
type.flags & TypeFlags.Any || getIndexInfoOfType(type, IndexKind.String) ? stringType :