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

[netcore] Make System.Reflection.Tests.TypeTests_PrefixingOnlyAllowedOnGetMember.TestGetMemberAll Pass #15343

Closed
steveisok opened this issue Jun 21, 2019 · 0 comments · Fixed by #15641

Comments

@steveisok
Copy link
Contributor

@steveisok steveisok commented Jun 21, 2019

The test currently fails with:

System.Reflection.Tests.TypeTests_PrefixingOnlyAllowedOnGetMember.TestGetMemberAll [FAIL]
      Assert.Equal() Failure
      Expected: 5
      Actual:   0
      Stack Trace:
           at System.Reflection.Tests.TypeTests_PrefixingOnlyAllowedOnGetMember.TestGetMemberAll()
           at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

Determine why and make the test pass.

akoeplinger added a commit that referenced this issue Jul 11, 2019
Mono used to return `true` for these three cases (see System.Reflection.Tests.TypeTests.IsAssignableFrom tests):
```csharp
using System.Reflection;
using Xunit;

namespace ConsoleApp
{
    public static class Program
    {
        static void Main(string[] args)
        {
            Assert.False(typeof(TI_Interface1[]).GetTypeInfo().IsAssignableFrom(
                         typeof(TI_StructWithInterface[]).GetTypeInfo()));

            Assert.False(typeof(int?[]).GetTypeInfo().IsAssignableFrom(
                         typeof(int[]).GetTypeInfo()));

            Assert.False(typeof(int[]).GetTypeInfo().IsAssignableFrom(
                         typeof(int?[]).GetTypeInfo()));
            
        }
    }
    
    public interface TI_Interface1 { }
    public struct TI_StructWithInterface : TI_Interface1 { }
}
```
Fixes #10848
Fixes #15080

Unrelated  System.Reflection.MetadataLoadContext.Tests tests that don't fail anymore:
Close #15351
Close #15348
Close #15347
Close #15346
Close #15345
Close #15343
Close #15342
Close #15341
Close #15338
Close #15337
Close #15336
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.