@@ -14553,13 +14553,13 @@ namespace ts {
14553
14553
* * Ternary.Maybe if they are related with assumptions of other relationships, or
14554
14554
* * Ternary.False if they are not related.
14555
14555
*/
14556
- function isRelatedTo(source : Type, target : Type, reportErrors = false, headMessage?: DiagnosticMessage, isApparentIntersectionConstituent?: boolean): Ternary {
14556
+ function isRelatedTo(originalSource : Type, originalTarget : Type, reportErrors = false, headMessage?: DiagnosticMessage, isApparentIntersectionConstituent?: boolean): Ternary {
14557
14557
// Normalize the source and target types: Turn fresh literal types into regular literal types,
14558
14558
// turn deferred type references into regular type references, simplify indexed access and
14559
14559
// conditional types, and resolve substitution types to either the substitution (on the source
14560
14560
// side) or the type variable (on the target side).
14561
- source = getNormalizedType(source , /*writing*/ false);
14562
- target = getNormalizedType(target , /*writing*/ true);
14561
+ let source = getNormalizedType(originalSource , /*writing*/ false);
14562
+ let target = getNormalizedType(originalTarget , /*writing*/ true);
14563
14563
14564
14564
// Try to see if we're relating something like `Foo` -> `Bar | null | undefined`.
14565
14565
// If so, reporting the `null` and `undefined` in the type is hardly useful.
@@ -14692,6 +14692,8 @@ namespace ts {
14692
14692
}
14693
14693
14694
14694
if (!result && reportErrors) {
14695
+ source = originalSource.aliasSymbol ? originalSource : source;
14696
+ target = originalTarget.aliasSymbol ? originalTarget : target;
14695
14697
let maybeSuppress = overrideNextErrorInfo > 0;
14696
14698
if (maybeSuppress) {
14697
14699
overrideNextErrorInfo--;
0 commit comments