public static void Main() { Expression.Property(Expression.Parameter(typeof(int), ""), typeof(ExpressionPropertyString), "Property"); Expression.Property(null, typeof(ExpressionPropertyString), "StaticProperty"); Expression.Property(null, typeof(Derived), "ProtectedPropertyOnBase"); Expression.Property(null, typeof(Derived), "PublicPropertyOnBase"); UnknownType.Test(); UnknownString.Test(); Expression.Property(null, GetType(), "This string will not be reached"); // UnrecognizedReflectionAccessPattern }
public static void Main() { Expression.Field(Expression.Parameter(typeof(int), ""), typeof(ExpressionFieldString), "Field"); Expression.Field(null, typeof(ExpressionFieldString), "StaticField"); Expression.Field(null, typeof(Derived), "_protectedFieldOnBase"); Expression.Field(null, typeof(Derived), "_publicFieldOnBase"); UnknownType.Test(); UnknownString.Test(); Expression.Field(null, GetType(), "This string will not be reached"); // UnrecognizedReflectionAccessPattern }
public static void Main() { Expression.Property(Expression.Parameter(typeof(int), ""), typeof(ExpressionPropertyString), nameof(BasicProperty)); Expression.Property(null, typeof(ExpressionPropertyString), nameof(StaticProperty)); Expression.Property(null, typeof(Derived), "ProtectedPropertyOnBase"); Expression.Property(null, typeof(Derived), "PublicPropertyOnBase"); UnknownType.Test(); TestNull(); TestNoValue(); TestNullString(); TestEmptyString(); TestNoValueString(); UnknownString.Test(); Expression.Property(null, GetType(), "This string will not be reached"); // IL2072 }
public static void Main() { Expression.Field(Expression.Parameter(typeof(int), ""), typeof(ExpressionFieldString), "InstanceField"); Expression.Field(null, typeof(ExpressionFieldString), "StaticField"); Expression.Field(null, typeof(ExpressionFieldString), "StaticWithDAM"); // IL2110 Expression.Field(null, typeof(Derived), "_protectedFieldOnBase"); Expression.Field(null, typeof(Derived), "_publicFieldOnBase"); // IL2110 UnknownType.Test(); UnknownTypeNoAnnotation.Test(); UnknownString.Test(); Expression.Field(null, GetType(), "This string will not be reached"); // IL2072 TestNullType(); TestNoValue(); TestNullString(); TestEmptyString(); TestNoValueString(); }