Skip to content

Commit d3d282c

Browse files
Less code
1 parent a008792 commit d3d282c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15730,17 +15730,13 @@ namespace ts {
1573015730
function reportRelationError(message: DiagnosticMessage | undefined, source: Type, target: Type) {
1573115731
if (incompatibleStack.length) reportIncompatibleStack();
1573215732
const [sourceType, targetType] = getTypeNamesForErrorDisplay(source, target);
15733-
let generalizedSource: Type;
15734-
let generalizedSourceType: string;
15733+
let generalizedSource = source;
15734+
let generalizedSourceType = sourceType;
1573515735

1573615736
if (isLiteralType(source) && !typeCouldHaveTopLevelSingletonTypes(target)) {
1573715737
generalizedSource = getBaseTypeOfLiteralType(source);
1573815738
generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource);
1573915739
}
15740-
else {
15741-
generalizedSource = source;
15742-
generalizedSourceType = sourceType;
15743-
}
1574415740

1574515741
if (target.flags & TypeFlags.TypeParameter) {
1574615742
const constraint = getBaseConstraintOfType(target);

0 commit comments

Comments
 (0)