mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
fix crash in getReturnTypeFromFunctionBody if function declaration is incomplete and does not have body
This commit is contained in:
parent
9f49a1637a
commit
732ebf2aeb
@ -6525,6 +6525,9 @@ module ts {
|
||||
|
||||
function getReturnTypeFromBody(func: FunctionLikeDeclaration, contextualMapper?: TypeMapper): Type {
|
||||
var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func);
|
||||
if (!func.body) {
|
||||
return unknownType;
|
||||
}
|
||||
if (func.body.kind !== SyntaxKind.Block) {
|
||||
var type = checkExpressionCached(<Expression>func.body, contextualMapper);
|
||||
}
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// var x: { f(): string } = { f( }
|
||||
|
||||
verify.numberOfErrorsInCurrentFile(1);
|
||||
Loading…
x
Reference in New Issue
Block a user