-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Closed
Copy link
Description
TypeScript Version: 3.5.1 and up
Code
class Test {
layouts = {
contours: {
'visibility': 'visible',
'line-join': 'round',
'line-cap': 'round'
},
museums: {
'visibility': 'visible'
}
};
toggleLayer(evt: { value: 'contours' | 'museums' }) {
this.layouts[evt.value] = { // <== COMPILATION ERROR HERE
...this.layouts[evt.value],
visibility: this.layouts[evt.value].visibility === 'visible' ? 'none' : 'visible'
};
}
}Expected behavior: Code compiles
Actual behavior: Code produces a compilation error. Version < 3.5 works fine
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels