@@ -2169,7 +2169,7 @@ export class Parser extends DiagnosticEmitter {
2169
2169
tn . range ( )
2170
2170
) ;
2171
2171
}
2172
- returnType = this . parseType ( tn , name . kind == NodeKind . CONSTRUCTOR || isSetter ) ;
2172
+ returnType = this . parseType ( tn , isSetter || name . kind == NodeKind . CONSTRUCTOR ) ;
2173
2173
if ( ! returnType ) return null ;
2174
2174
} else {
2175
2175
returnType = Node . createOmittedType ( tn . range ( tn . pos ) ) ;
@@ -2209,7 +2209,7 @@ export class Parser extends DiagnosticEmitter {
2209
2209
}
2210
2210
body = this . parseBlockStatement ( tn , false ) ;
2211
2211
if ( ! body ) return null ;
2212
- } else if ( ! ( flags & ( CommonFlags . AMBIENT | CommonFlags . ABSTRACT ) ) && ! isInterface ) {
2212
+ } else if ( ! isInterface && ! ( flags & ( CommonFlags . AMBIENT | CommonFlags . ABSTRACT ) ) ) {
2213
2213
this . error (
2214
2214
DiagnosticCode . Function_implementation_is_missing_or_not_immediately_following_the_declaration ,
2215
2215
tn . range ( )
@@ -2225,7 +2225,9 @@ export class Parser extends DiagnosticEmitter {
2225
2225
body ,
2226
2226
tn . range ( startPos , tn . pos )
2227
2227
) ;
2228
- tn . skip ( Token . SEMICOLON ) ;
2228
+ if ( ! ( isInterface && tn . skip ( Token . COMMA ) ) ) {
2229
+ tn . skip ( Token . SEMICOLON ) ;
2230
+ }
2229
2231
return retMethod ;
2230
2232
2231
2233
} else if ( isConstructor ) {
@@ -2288,7 +2290,10 @@ export class Parser extends DiagnosticEmitter {
2288
2290
if ( ! initializer ) return null ;
2289
2291
}
2290
2292
let range = tn . range ( startPos , tn . pos ) ;
2291
- if ( ( flags & CommonFlags . DEFINITELY_ASSIGNED ) != 0 && ( ( flags & CommonFlags . STATIC ) != 0 || isInterface || initializer !== null ) ) {
2293
+ if (
2294
+ ( flags & CommonFlags . DEFINITELY_ASSIGNED ) != 0 &&
2295
+ ( isInterface || initializer !== null || ( flags & CommonFlags . STATIC ) != 0 )
2296
+ ) {
2292
2297
this . error (
2293
2298
DiagnosticCode . A_definite_assignment_assertion_is_not_permitted_in_this_context ,
2294
2299
range
@@ -2302,7 +2307,9 @@ export class Parser extends DiagnosticEmitter {
2302
2307
initializer ,
2303
2308
range
2304
2309
) ;
2305
- tn . skip ( Token . SEMICOLON ) ;
2310
+ if ( ! ( isInterface && tn . skip ( Token . COMMA ) ) ) {
2311
+ tn . skip ( Token . SEMICOLON ) ;
2312
+ }
2306
2313
return retField ;
2307
2314
}
2308
2315
return null ;
0 commit comments