File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -119,14 +119,15 @@ public void OperatorCall(ExpressionSyntax node)
119119 var @operator = cx . GetSymbolInfo ( node ) ;
120120 var method = @operator . Symbol as IMethodSymbol ;
121121
122- if ( GetCallType ( cx , node ) == CallType . Dynamic )
122+ var callType = GetCallType ( cx , node ) ;
123+ if ( callType == CallType . Dynamic )
123124 {
124125 UserOperator . OperatorSymbol ( method . Name , out string operatorName ) ;
125126 cx . Emit ( Tuples . dynamic_member_name ( this , operatorName ) ) ;
126127 return ;
127128 }
128129
129- if ( method != null )
130+ if ( callType != CallType . None )
130131 cx . Emit ( Tuples . expr_call ( this , Method . Create ( cx , method ) ) ) ;
131132 }
132133
@@ -148,12 +149,9 @@ public static CallType GetCallType(Context cx, ExpressionSyntax node)
148149 {
149150 var @operator = cx . GetSymbolInfo ( node ) ;
150151
151- if ( @operator . Symbol != null )
152+ if ( @operator . Symbol is IMethodSymbol method )
152153 {
153- var method = @operator . Symbol as IMethodSymbol ;
154-
155- var containingSymbol = method . ContainingSymbol as ITypeSymbol ;
156- if ( containingSymbol != null && containingSymbol . TypeKind == Microsoft . CodeAnalysis . TypeKind . Dynamic )
154+ if ( method . ContainingSymbol is ITypeSymbol containingSymbol && containingSymbol . TypeKind == Microsoft . CodeAnalysis . TypeKind . Dynamic )
157155 {
158156 return CallType . Dynamic ;
159157 }
You can’t perform that action at this time.
0 commit comments