@@ -298,7 +298,7 @@ private TryExpression CreateTrySimpleAssign()
298298 var changeTypeMethod = typeof ( PropertySetterBuilder ) . GetMethod ( "SafeConvert" ,
299299 BindingFlags . Static | BindingFlags . NonPublic ) ;
300300 callConvert = Expression . Call ( changeTypeMethod , _itemProperty ,
301- Expression . Constant ( _property . PropertyType . GetEnumUnderlyingType ( ) ) ) ;
301+ Expression . Constant ( _property . PropertyType . GetEnumUnderlyingType ( ) , typeof ( Type ) ) ) ;
302302 }
303303 else if ( _property . PropertyType . IsGenericType && _property . PropertyType . GetGenericTypeDefinition ( ) == typeof ( Nullable < > ) )
304304 {
@@ -313,7 +313,7 @@ private TryExpression CreateTrySimpleAssign()
313313 var changeTypeMethod = typeof ( PropertySetterBuilder ) . GetMethod ( "SafeConvert" ,
314314 BindingFlags . Static | BindingFlags . NonPublic ) ;
315315 callConvert = Expression . Call ( changeTypeMethod , _itemProperty ,
316- Expression . Constant ( _property . PropertyType ) ) ;
316+ Expression . Constant ( _property . PropertyType , typeof ( Type ) ) ) ;
317317 }
318318
319319 var assign = Expression . Assign ( _nameProperty , Expression . Convert ( callConvert , _property . PropertyType ) ) ;
@@ -323,7 +323,7 @@ private TryExpression CreateTrySimpleAssign()
323323 Expression . IfThenElse ( Expression . TypeIs ( _itemProperty , typeof ( string ) ) ,
324324 Expression . Assign ( _nameProperty ,
325325 Expression . Convert ( Expression . Call ( typeof ( Enum ) . GetMethod ( "Parse" , new [ ] { typeof ( Type ) , typeof ( string ) , typeof ( bool ) } ) ,
326- Expression . Constant ( _property . PropertyType ) ,
326+ Expression . Constant ( _property . PropertyType , typeof ( Type ) ) ,
327327 Expression . Call ( _itemProperty , typeof ( object ) . GetMethod ( "ToString" ) ) , Expression . Constant ( true ) ) , _property . PropertyType ) ) ,
328328 assign ) , Expression . Catch ( typeof ( Exception ) , Expression . Empty ( ) ) ) ;
329329 }
@@ -344,7 +344,7 @@ private TryExpression CreateTrySimpleArrayAssign()
344344 Expression . IfThenElse ( Expression . TypeIs ( _itemProperty , typeof ( string ) ) ,
345345 Expression . Assign ( _nameProperty ,
346346 Expression . Convert ( Expression . Call ( typeof ( Enum ) . GetMethod ( "Parse" , new [ ] { typeof ( Type ) , typeof ( string ) , typeof ( bool ) } ) ,
347- Expression . Constant ( _property . PropertyType ) ,
347+ Expression . Constant ( _property . PropertyType , typeof ( Type ) ) ,
348348 Expression . Call ( _itemProperty , typeof ( object ) . GetMethod ( "ToString" ) ) , Expression . Constant ( true ) ) , _property . PropertyType ) ) ,
349349 assign ) , Expression . Catch ( typeof ( Exception ) , Expression . Empty ( ) ) ) ;
350350 }
0 commit comments