Skip to content

Commit

Permalink
Fix misspelling and remove unneeded branch
Browse files Browse the repository at this point in the history
  • Loading branch information
weswigham committed May 31, 2019
1 parent c88cca6 commit c96fee1
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/compiler/checker.ts
Expand Up @@ -12981,16 +12981,14 @@ namespace ts {
return result;
}

function propegateSidebandVarianceFlags(typeArguments: readonly Type[], variances: VarianceFlags[]) {
if (outofbandVarianceMarkerHandler) {
for (let i = 0; i < variances.length; i++) {
const v = variances[i];
if (v & VarianceFlags.Unmeasurable) {
instantiateType(typeArguments[i], reportUnmeasurableMarkers);
}
if (v & VarianceFlags.Unreliable) {
instantiateType(typeArguments[i], reportUnreliableMarkers);
}
function propagateSidebandVarianceFlags(typeArguments: readonly Type[], variances: VarianceFlags[]) {
for (let i = 0; i < variances.length; i++) {
const v = variances[i];
if (v & VarianceFlags.Unmeasurable) {
instantiateType(typeArguments[i], reportUnmeasurableMarkers);
}
if (v & VarianceFlags.Unreliable) {
instantiateType(typeArguments[i], reportUnreliableMarkers);
}
}
}
Expand All @@ -13016,10 +13014,10 @@ namespace ts {
// We're in the middle of variance checking - integrate any unmeasurable/unreliable flags from this cached component
if (source.flags & (TypeFlags.Object | TypeFlags.Conditional) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) {
propegateSidebandVarianceFlags(source.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
propagateSidebandVarianceFlags(source.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
}
if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && (<TypeReference>source).target === (<TypeReference>target).target && length((<TypeReference>source).typeArguments)) {
propegateSidebandVarianceFlags((<TypeReference>source).typeArguments!, getVariances((<TypeReference>source).target));
propagateSidebandVarianceFlags((<TypeReference>source).typeArguments!, getVariances((<TypeReference>source).target));
}
}
return related === RelationComparisonResult.Succeeded ? Ternary.True : Ternary.False;
Expand Down

0 comments on commit c96fee1

Please sign in to comment.