Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests documenting a CLR bug in System.Reflection.Emit #353

Merged
merged 1 commit into from
May 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,33 @@ public void Can_intercept_method_having_valuetypes_parameter_with_in_modifier()
Assert.AreEqual(expectedValue, ((ReadOnlyStruct)receivedArg).Value);
}

[Test]
[Ignore("Fails on both the CLR and CoreCLR with a MissingMethodException due to a bug in System.Reflection.Emit. See https://github.com/dotnet/corefx/issues/29254.")]
public void Can_proxy_method_in_generic_type_having_valuetyped_parameter_with_in_modifier()
{
var proxy = this.generator.CreateInterfaceProxyWithoutTarget<IGenericTypeWithInModifier<bool>>(new DoNothingInterceptor());
var readOnlyStruct = new ReadOnlyStruct();
proxy.Method(in readOnlyStruct);
}

[Test]
[Ignore("Fails on both the CLR and CoreCLR with a MissingMethodException due to a bug in System.Reflection.Emit. See https://github.com/dotnet/corefx/issues/29254.")]
public void Can_proxy_generic_method_in_nongeneric_type_having_valuetyped_parameter_with_in_modifier()
{
var proxy = this.generator.CreateInterfaceProxyWithoutTarget<IGenericMethodWithInModifier>(new DoNothingInterceptor());
var readOnlyStruct = new ReadOnlyStruct();
proxy.Method<bool>(in readOnlyStruct);
}

[Test]
[Ignore("Fails on both the CLR and CoreCLR with a MissingMethodException due to a bug in System.Reflection.Emit. See https://github.com/dotnet/corefx/issues/29254.")]
public void Can_proxy_generic_method_in_generic_type_having_valuetyped_parameter_with_in_modifier()
{
var proxy = this.generator.CreateInterfaceProxyWithoutTarget<IGenericTypeAndMethodWithInModifier<bool>>(new DoNothingInterceptor());
var readOnlyStruct = new ReadOnlyStruct();
proxy.Method<int>(in readOnlyStruct);
}

#endif

public readonly struct ReadOnlyStruct
Expand All @@ -86,5 +113,20 @@ public interface IWithInModifier
{
void Method(in ReadOnlyStruct readOnlyStruct);
}

public interface IGenericMethodWithInModifier
{
void Method<T>(in ReadOnlyStruct readOnlyStruct);
}

public interface IGenericTypeWithInModifier<T>
{
void Method(in ReadOnlyStruct readOnlyStruct);
}

public interface IGenericTypeAndMethodWithInModifier<T>
{
void Method<U>(in ReadOnlyStruct readOnlyStruct);
}
}
}