-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureBreaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 2.7.2
Search Terms: Object.getPrototypeOf
, ObjectConstructor.getPrototypeOf
, wrong return type
Code
let prototype = Object.getPrototypeOf(foo);
Expected behavior:
The type of prototype
should be object | null
. According to the spec, getPrototypeOf
returns the value of the internal property [[Prototype]]
[1] whose values can only be of type object
or null
[2].
Actual behavior:
prototype
has type any
Playground Link: here
trusktr, treblasft, dhoulb, Tete1805, al3xnag and 1 more
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureBreaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeSuggestionAn idea for TypeScriptAn idea for TypeScript