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 {
4875
4875
let targetReturnType = getReturnTypeOfSignature(target);
4876
4876
if (targetReturnType === voidType) return result;
4877
4877
let sourceReturnType = getReturnTypeOfSignature(source);
4878
-
4879
- let targetReturnDecl = targetReturnType.symbol && getDeclarationOfKind(targetReturnType.symbol, SyntaxKind.ClassDeclaration);
4878
+
4880
4879
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) {
4884
4886
reportError(Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type);
4885
4887
}
4886
4888
return Ternary.False;
4887
4889
}
4888
-
4890
+
4889
4891
return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors);
4890
4892
}
4891
4893
You can’t perform that action at this time.
0 commit comments