mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-16 06:59:15 -05:00
Re-enable weak type check for intersection props
Previously, intersections disabled the weak type check for their constituents, and all properties (recursively) of their constituents. Also add test for this case.
This commit is contained in:
@@ -9352,7 +9352,10 @@ namespace ts {
|
||||
}
|
||||
return Ternary.False;
|
||||
}
|
||||
const saveDisableWeakTypeErrors = disableWeakTypeErrors;
|
||||
disableWeakTypeErrors = false;
|
||||
const related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors);
|
||||
disableWeakTypeErrors = saveDisableWeakTypeErrors;
|
||||
if (!related) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp));
|
||||
|
||||
Reference in New Issue
Block a user