Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Remove test that sets static readonly field after type initialization (
Browse files Browse the repository at this point in the history
…#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 stephentoub committed Nov 12, 2018
1 parent e9d7a5f commit 4914440
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 4914440

Please sign in to comment.