mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fixed a crash when inferring return type of an accessor with errors in its return statement (#56258)
This commit is contained in:
@@ -7315,7 +7315,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
|
||||
if (propertySymbol.flags & SymbolFlags.Accessor) {
|
||||
const writeType = getWriteTypeOfSymbol(propertySymbol);
|
||||
if (propertyType !== writeType) {
|
||||
if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
|
||||
const getterDeclaration = getDeclarationOfKind<GetAccessorDeclaration>(propertySymbol, SyntaxKind.GetAccessor)!;
|
||||
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
|
||||
typeElements.push(
|
||||
|
||||
Reference in New Issue
Block a user