File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -4875,17 +4875,19 @@ namespace ts {
48754875 let targetReturnType = getReturnTypeOfSignature(target);
48764876 if (targetReturnType === voidType) return result;
48774877 let sourceReturnType = getReturnTypeOfSignature(source);
4878-
4879- let targetReturnDecl = targetReturnType.symbol && getDeclarationOfKind(targetReturnType.symbol, SyntaxKind.ClassDeclaration);
4878+
48804879 let sourceReturnDecl = sourceReturnType.symbol && getDeclarationOfKind(sourceReturnType.symbol, SyntaxKind.ClassDeclaration);
4881-
4882- if(sourceReturnDecl && sourceReturnDecl.flags & NodeFlags.Abstract && (!targetReturnDecl || !(targetReturnDecl.flags & NodeFlags.Abstract))) {
4883- if(reportErrors) {
4880+ let targetReturnDecl = targetReturnType.symbol && getDeclarationOfKind(targetReturnType.symbol, SyntaxKind.ClassDeclaration);
4881+ let sourceIsAbstract = sourceReturnDecl && sourceReturnDecl.flags & NodeFlags.Abstract;
4882+ let targetIsAbstract = targetReturnDecl && targetReturnDecl.flags & NodeFlags.Abstract;
4883+
4884+ if (sourceIsAbstract && !targetIsAbstract) {
4885+ if (reportErrors) {
48844886 reportError(Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type);
48854887 }
48864888 return Ternary.False;
48874889 }
4888-
4890+
48894891 return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors);
48904892 }
48914893
You can’t perform that action at this time.
0 commit comments