mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 20:25:23 -06:00
Yield and yield* have type any
This commit is contained in:
parent
65222d6ef1
commit
eada0cd4a7
@ -7899,11 +7899,14 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function checkYieldExpression(node: YieldExpression): void {
|
||||
function checkYieldExpression(node: YieldExpression): Type {
|
||||
// Grammar checking
|
||||
if (!(node.parserContextFlags & ParserContextFlags.Yield)) {
|
||||
grammarErrorOnFirstToken(node, Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_declaration);
|
||||
}
|
||||
|
||||
// Both yield and yield* expressions are any
|
||||
return anyType;
|
||||
}
|
||||
|
||||
function checkConditionalExpression(node: ConditionalExpression, contextualMapper?: TypeMapper): Type {
|
||||
@ -8093,8 +8096,7 @@ module ts {
|
||||
case SyntaxKind.OmittedExpression:
|
||||
return undefinedType;
|
||||
case SyntaxKind.YieldExpression:
|
||||
checkYieldExpression(<YieldExpression>node);
|
||||
return unknownType;
|
||||
return checkYieldExpression(<YieldExpression>node);
|
||||
}
|
||||
return unknownType;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user