Make certain types of FunctionLike require block bodies

This commit is contained in:
Jason Freeman 2014-11-05 18:04:19 -08:00
parent 6c85dbe140
commit bc70e4a29d
2 changed files with 11 additions and 4 deletions

View File

@ -3572,7 +3572,7 @@ module ts {
// A common error is to try to declare an accessor in an ambient class.
if (inAmbientContext && canParseSemicolon()) {
parseSemicolon();
node.body = createMissingNode();
node.body = <Block>createMissingNode();
}
else {
node.body = parseBody(/* ignoreMissingOpenBrace */ false);

View File

@ -336,13 +336,20 @@ module ts {
export interface FunctionDeclaration extends FunctionLike {
name: Identifier;
body?: Block;
}
export interface MethodDeclaration extends FunctionLike { }
export interface MethodDeclaration extends FunctionLike {
body?: Block;
}
export interface ConstructorDeclaration extends FunctionLike { }
export interface ConstructorDeclaration extends FunctionLike {
body?: Block;
}
export interface AccessorDeclaration extends FunctionLike { }
export interface AccessorDeclaration extends FunctionLike {
body?: Block;
}
export interface TypeNode extends Node { }