@@ -132,44 +132,42 @@ internal IAnalysisSet ProcessFunctionDecorators(DDG ddg) {
132132 if ( Ast . Decorators != null ) {
133133 Expression expr = Ast . NameExpression ;
134134
135- foreach ( var d in Ast . Decorators . DecoratorsInternal ) {
136- if ( d != null ) {
137- var decorator = ddg . _eval . Evaluate ( d ) ;
138-
139- if ( decorator . Contains ( State . ClassInfos [ BuiltinTypeId . Property ] ) ) {
140- Function . IsProperty = true ;
141- } else if ( decorator . Contains ( State . ClassInfos [ BuiltinTypeId . StaticMethod ] ) ) {
142- // TODO: Warn if IsClassMethod is set
143- Function . IsStatic = true ;
144- } else if ( decorator . Contains ( State . ClassInfos [ BuiltinTypeId . ClassMethod ] ) ) {
145- // TODO: Warn if IsStatic is set
146- Function . IsClassMethod = true ;
147- } else if ( ProcessAbstractDecorators ( decorator ) ) {
148- // No-op
149- } else {
150- Expression nextExpr ;
151- if ( ! _decoratorCalls . TryGetValue ( d , out nextExpr ) ) {
152- nextExpr = _decoratorCalls [ d ] = new CallExpression ( d , new [ ] { new Arg ( expr ) } ) ;
153- nextExpr . SetLoc ( d . IndexSpan ) ;
154- }
155- expr = nextExpr ;
156- var decorated = AnalysisSet . Empty ;
157- var anyResults = false ;
158- foreach ( var ns in decorator ) {
159- var fd = ns as FunctionInfo ;
160- if ( fd != null && InterpreterScope . EnumerateTowardsGlobal . Any ( s => s . AnalysisValue == fd ) ) {
161- continue ;
162- }
163- decorated = decorated . Union ( ns . Call ( expr , this , new [ ] { types } , ExpressionEvaluator . EmptyNames ) ) ;
164- anyResults = true ;
165- }
135+ foreach ( var d in Ast . Decorators . Decorators . ExcludeDefault ( ) ) {
136+ var decorator = ddg . _eval . Evaluate ( d ) ;
166137
167- // If processing decorators, update the current
168- // function type. Otherwise, we are acting as if
169- // each decorator returns the function unmodified.
170- if ( ddg . ProjectState . Limits . ProcessCustomDecorators && anyResults ) {
171- types = decorated ;
138+ if ( decorator . Contains ( State . ClassInfos [ BuiltinTypeId . Property ] ) ) {
139+ Function . IsProperty = true ;
140+ } else if ( decorator . Contains ( State . ClassInfos [ BuiltinTypeId . StaticMethod ] ) ) {
141+ // TODO: Warn if IsClassMethod is set
142+ Function . IsStatic = true ;
143+ } else if ( decorator . Contains ( State . ClassInfos [ BuiltinTypeId . ClassMethod ] ) ) {
144+ // TODO: Warn if IsStatic is set
145+ Function . IsClassMethod = true ;
146+ } else if ( ProcessAbstractDecorators ( decorator ) ) {
147+ // No-op
148+ } else {
149+ Expression nextExpr ;
150+ if ( ! _decoratorCalls . TryGetValue ( d , out nextExpr ) ) {
151+ nextExpr = _decoratorCalls [ d ] = new CallExpression ( d , new [ ] { new Arg ( expr ) } ) ;
152+ nextExpr . SetLoc ( d . IndexSpan ) ;
153+ }
154+ expr = nextExpr ;
155+ var decorated = AnalysisSet . Empty ;
156+ var anyResults = false ;
157+ foreach ( var ns in decorator ) {
158+ var fd = ns as FunctionInfo ;
159+ if ( fd != null && InterpreterScope . EnumerateTowardsGlobal . Any ( s => s . AnalysisValue == fd ) ) {
160+ continue ;
172161 }
162+ decorated = decorated . Union ( ns . Call ( expr , this , new [ ] { types } , ExpressionEvaluator . EmptyNames ) ) ;
163+ anyResults = true ;
164+ }
165+
166+ // If processing decorators, update the current
167+ // function type. Otherwise, we are acting as if
168+ // each decorator returns the function unmodified.
169+ if ( ddg . ProjectState . Limits . ProcessCustomDecorators && anyResults ) {
170+ types = decorated ;
173171 }
174172 }
175173 }
@@ -181,8 +179,8 @@ internal IAnalysisSet ProcessFunctionDecorators(DDG ddg) {
181179 internal void AnalyzeDefaultParameters ( DDG ddg ) {
182180 IVariableDefinition param ;
183181 var scope = ( FunctionScope ) Scope ;
184- for ( var i = 0 ; i < Ast . ParametersInternal . Length ; ++ i ) {
185- var p = Ast . ParametersInternal [ i ] ;
182+ for ( var i = 0 ; i < Ast . Parameters . Length ; ++ i ) {
183+ var p = Ast . Parameters [ i ] ;
186184 if ( p . Annotation != null ) {
187185 var val = ddg . _eval . EvaluateAnnotation ( p . Annotation ) ;
188186 if ( val ? . Any ( ) == true && Scope . TryGetVariable ( p . Name , out param ) ) {
@@ -232,7 +230,7 @@ public override string ToString() {
232230 return "{0}{1}({2})->{3}" . FormatInvariant (
233231 base . ToString ( ) ,
234232 " def:" ,
235- string . Join ( ", " , Ast . ParametersInternal . Select ( p => InterpreterScope . TryGetVariable ( p . Name , out var v ) ? v . Types . ToString ( ) : "{}" ) ) ,
233+ string . Join ( ", " , Ast . Parameters . Select ( p => InterpreterScope . TryGetVariable ( p . Name , out var v ) ? v . Types . ToString ( ) : "{}" ) ) ,
236234 ( ( FunctionScope ) Scope ) . ReturnValue . Types . ToString ( )
237235 ) ;
238236 }
0 commit comments