-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Object.keys has wrong return type from 2.1 #12870
Copy link
Copy link
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 2.1.4
Code
let test = {a:1, b:1};
let a = Object.keys(test); //currently string[]
interface ObjectConstructor2 extends ObjectConstructor {
keys<T>(o: T): (keyof T)[];
}
let correct = (<ObjectConstructor2>Object).keys(test);Expected behavior:
keys actually returns keys
Actual behavior:
keys returns non-specific string array
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug