mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-25 08:22:15 +00:00
c# 7 features are breaking things
This commit is contained in:
@@ -19,7 +19,7 @@ namespace MonoGame.Extended.Tweening
|
||||
private static Func<object, object> CompileGetMethod(FieldInfo fieldInfo)
|
||||
{
|
||||
var self = Expression.Parameter(typeof(object));
|
||||
var instance = Expression.Convert(self, fieldInfo.DeclaringType ?? throw new InvalidOperationException());
|
||||
var instance = Expression.Convert(self, fieldInfo.DeclaringType);
|
||||
var field = Expression.Field(instance, fieldInfo);
|
||||
var convert = Expression.TypeAs(field, typeof(object));
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ namespace MonoGame.Extended.Tweening
|
||||
|
||||
public T Value
|
||||
{
|
||||
get => (T)_getMethod(Target);
|
||||
set => _setMethod(Target, value);
|
||||
get { return (T) _getMethod(Target); }
|
||||
set { _setMethod(Target, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ namespace MonoGame.Extended.Tweening
|
||||
private static Func<object, object> CompileGetMethod(PropertyInfo propertyInfo)
|
||||
{
|
||||
var param = Expression.Parameter(typeof(object));
|
||||
var instance = Expression.Convert(param, propertyInfo.DeclaringType ?? throw new InvalidOperationException());
|
||||
var instance = Expression.Convert(param, propertyInfo.DeclaringType);
|
||||
var convert = Expression.TypeAs(Expression.Property(instance, propertyInfo), typeof(object));
|
||||
return Expression.Lambda<Func<object, object>>(convert, param).Compile();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user