Skip to content

Commit

Permalink
Remove test that sets static readonly field after type initialization (
Browse files Browse the repository at this point in the history
…dotnet#33413)

dotnet/coreclr#20866 extends the jit to incorporate the type of readonly ref
class typed static fields into jitted code when jitting happens after class
initialization. For instance, the jit may optimize type tests or devirtualize
calls.

With the advent of type based jit optimizations we are also blocking reflection
based updates to all readonly static fields after class initialization.
  • Loading branch information
AndyAyersMS authored and jlennox committed Dec 16, 2018
1 parent 9e57609 commit 5ce3a59
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/System.Linq.Expressions/tests/MemberInit/BindTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,21 +223,6 @@ public void StaticField(bool useInterpreter)
Assert.Equal("ABC", PropertyAndFields.StaticStringField);
}

[Theory, ClassData(typeof(CompilationTypes))]
public void StaticReadonlyField(bool useInterpreter)
{
MemberInfo member = typeof(PropertyAndFields).GetMember(nameof(PropertyAndFields.StaticReadonlyStringField))[0];
Expression<Func<PropertyAndFields>> assignToReadonly = Expression.Lambda<Func<PropertyAndFields>>(
Expression.MemberInit(
Expression.New(typeof(PropertyAndFields)),
Expression.Bind(member, Expression.Constant("ABC" + useInterpreter))
)
);
Func<PropertyAndFields> func = assignToReadonly.Compile(useInterpreter);
func();
Assert.Equal("ABC" + useInterpreter, PropertyAndFields.StaticReadonlyStringField);
}

[Theory, ClassData(typeof(CompilationTypes))]
public void StaticProperty(bool useInterpreter)
{
Expand Down

0 comments on commit 5ce3a59

Please sign in to comment.