@@ -66,7 +66,8 @@ import {
66
66
VariableLikeDeclarationStatement ,
67
67
VariableStatement ,
68
68
69
- decoratorNameToKind
69
+ decoratorNameToKind ,
70
+ findDecorator
70
71
} from "./ast" ;
71
72
72
73
import {
@@ -948,7 +949,7 @@ export class Program extends DiagnosticEmitter {
948
949
Type . void , // resolved later on
949
950
declaration ,
950
951
decorators
951
- ? this . checkDecorators ( decorators , DecoratorFlags . NONE )
952
+ ? this . checkDecorators ( decorators , DecoratorFlags . INLINE )
952
953
: DecoratorFlags . NONE
953
954
) ;
954
955
staticField . parent = classPrototype ;
@@ -958,6 +959,13 @@ export class Program extends DiagnosticEmitter {
958
959
staticField . set ( CommonFlags . MODULE_EXPORT ) ;
959
960
}
960
961
962
+ if ( staticField . hasDecorator ( DecoratorFlags . INLINE ) && ! staticField . is ( CommonFlags . READONLY ) ) {
963
+ this . error (
964
+ DiagnosticCode . Decorator_0_is_not_valid_here ,
965
+ assert ( findDecorator ( DecoratorKind . INLINE , decorators ) ) . range , "inline"
966
+ ) ;
967
+ }
968
+
961
969
// instance fields are remembered until resolved
962
970
} else {
963
971
if ( isInterface ) {
@@ -1946,6 +1954,13 @@ export class Program extends DiagnosticEmitter {
1946
1954
global . parent = namespace ;
1947
1955
this . elementsLookup . set ( internalName , global ) ;
1948
1956
1957
+ if ( global . hasDecorator ( DecoratorFlags . INLINE ) && ! global . is ( CommonFlags . CONST ) ) {
1958
+ this . error (
1959
+ DiagnosticCode . Decorator_0_is_not_valid_here ,
1960
+ assert ( findDecorator ( DecoratorKind . INLINE , decorators ) ) . range , "inline"
1961
+ ) ;
1962
+ }
1963
+
1949
1964
if ( namespace ) {
1950
1965
if ( namespace . members ) {
1951
1966
if ( namespace . members . has ( simpleName ) ) {
0 commit comments