@@ -28,7 +28,7 @@ class StaticInvokeExpr : Expr, MaybePrimitiveExpr
2828 readonly bool _variadic ;
2929 readonly object _tag ;
3030
31- public MethodInfo Method { get { return _method ; } }
31+ public MethodInfo Method => _method ;
3232
3333 Type _cachedType ;
3434
@@ -51,10 +51,7 @@ public StaticInvokeExpr(Type target, MethodInfo method, bool variadic, IPersiste
5151
5252 #region Type mangling
5353
54- public bool HasClrType
55- {
56- get { return true ; }
57- }
54+ public bool HasClrType => true ;
5855
5956 public Type ClrType
6057 {
@@ -72,7 +69,7 @@ public Type ClrType
7269
7370 public static Expr Parse ( Var v , ISeq args , object tag )
7471 {
75- if ( ! v . isBound || v . get ( ) == null )
72+ if ( ! v . isBound || v . get ( ) is null )
7673 {
7774 //Console.WriteLine("Not bound: {0}", v);
7875 return null ;
@@ -86,12 +83,12 @@ public static Expr Parse(Var v, ISeq args, object tag)
8683 // We do not want to direct link to if we going into a non-PersistedAssemblyBuilder assembly --
8784 // this throws an exception when generating the method call IL in the StaticInvokeExpr.Emit
8885
89- if ( Compiler . IsCompiling &&
86+ if ( Compiler . IsCompiling &&
9087 Compiler . CompilerContextVar . deref ( ) is GenContext context &&
91- ! GenContext . IsInternalAssembly ( context . AssemblyBuilder ) &&
88+ ! GenContext . IsInternalAssembly ( context . AssemblyBuilder ) &&
9289 Compiler . TryGetDirectLink ( v , out Type t ) )
9390 {
94- if ( t != null )
91+ if ( t is not null )
9592 target = t ;
9693 }
9794 }
@@ -123,7 +120,7 @@ public static Expr Parse(Var v, ISeq args, object tag)
123120 }
124121 }
125122
126- if ( method == null )
123+ if ( method is null )
127124 return null ;
128125
129126 IPersistentVector argv = PersistentVector . EMPTY ;
@@ -152,23 +149,18 @@ public void Emit(RHC rhc, ObjExpr objx, CljILGen ilg)
152149 EmitUnboxed ( rhc , objx , ilg ) ;
153150 if ( rhc != RHC . Statement )
154151 HostExpr . EmitBoxReturn ( objx , ilg , _retType ) ;
155- if ( rhc == RHC . Statement )
152+ if ( rhc == RHC . Statement )
156153 ilg . Emit ( OpCodes . Pop ) ;
157154 }
158155
159- public bool HasNormalExit ( )
160- {
161- return true ;
162- }
163-
156+ public bool HasNormalExit ( ) => true ;
164157
165158 public void EmitUnboxed ( RHC rhc , ObjExpr objx , CljILGen ilg )
166159 {
167160 if ( _variadic )
168161 {
169-
170162 ParameterInfo [ ] pinfos = _method . GetParameters ( ) ;
171- for ( int i = 0 ; i < pinfos . Length - 1 ; i ++ )
163+ for ( int i = 0 ; i < pinfos . Length - 1 ; i ++ )
172164 {
173165 Expr e = ( Expr ) _args . nth ( i ) ;
174166 if ( Compiler . MaybePrimitiveType ( e ) == pinfos [ i ] . ParameterType )
@@ -181,7 +173,7 @@ public void EmitUnboxed(RHC rhc, ObjExpr objx, CljILGen ilg)
181173 }
182174 IPersistentVector restArgs = RT . subvec ( _args , pinfos . Length - 1 , _args . count ( ) ) ;
183175 MethodExpr . EmitArgsAsArray ( restArgs , objx , ilg ) ;
184- ilg . EmitCall ( Compiler . Method_ArraySeq_create ) ;
176+ ilg . EmitCall ( Compiler . Method_ArraySeq_create ) ;
185177 }
186178 else
187179 MethodExpr . EmitTypedArgs ( objx , ilg , _method . GetParameters ( ) , _args ) ;
@@ -198,14 +190,11 @@ public void EmitUnboxed(RHC rhc, ObjExpr objx, CljILGen ilg)
198190 }
199191 }
200192
201- #endregion
193+ #endregion
202194
203195 #region MaybePrimitiveExpr Members
204196
205- public bool CanEmitPrimitive
206- {
207- get { return _retType . IsPrimitive ; }
208- }
197+ public bool CanEmitPrimitive => _retType . IsPrimitive ;
209198
210199 #endregion
211200 }
0 commit comments