-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Domain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
π Search Terms
divergent accessors setter getter expando js jsdoc
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
const x = {};
Object.defineProperty(x, "test", {
/** @returns {string} */
get() {
return "";
},
/** @param {number} a */
set(a) {},
});
function isolateFromExpandoAssignmentsBinding() {
x.test = 42; // error but should be OK
}π Actual behavior
The write type of this expando member is string
π Expected behavior
The write type of this expando member should be number since divergent accessors are allowed nowadays
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Domain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsSuggestionAn idea for TypeScriptAn idea for TypeScript