File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -11795,8 +11795,15 @@ namespace ts {
11795
11795
}
11796
11796
}
11797
11797
}
11798
- checkFlags |= (isReadonlySymbol(prop) ? CheckFlags.Readonly : 0) |
11799
- (!(modifiers & ModifierFlags.NonPublicAccessibilityModifier) ? CheckFlags.ContainsPublic : 0) |
11798
+ // For unions, prop is readonly if any definition of it is readonly
11799
+ if (isUnion && isReadonlySymbol(prop)) {
11800
+ checkFlags |= CheckFlags.Readonly;
11801
+ }
11802
+ // For intersections, prop is writable if any definition of it is writable
11803
+ else if (!isUnion && !isReadonlySymbol(prop)) {
11804
+ checkFlags &= ~CheckFlags.Readonly;
11805
+ }
11806
+ checkFlags |= (!(modifiers & ModifierFlags.NonPublicAccessibilityModifier) ? CheckFlags.ContainsPublic : 0) |
11800
11807
(modifiers & ModifierFlags.Protected ? CheckFlags.ContainsProtected : 0) |
11801
11808
(modifiers & ModifierFlags.Private ? CheckFlags.ContainsPrivate : 0) |
11802
11809
(modifiers & ModifierFlags.Static ? CheckFlags.ContainsStatic : 0);
You can’t perform that action at this time.
0 commit comments