Skip to content

Update assert and enable tests for CoreCLR #105266

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

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
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 @@ -194,7 +194,11 @@ protected virtual MethodInfo GetMethodImpl()
// RCWs don't need to be "strongly-typed" in which case we don't find a base type
// that matches the declaring type of the method. This is fine because interop needs
// to work with exact methods anyway so declaringType is never shared at this point.
Debug.Assert(currentType != null || _target.GetType().IsCOMObject, "The class hierarchy should declare the method");
// The targetType may also be an interface with a Default interface method (DIM).
Debug.Assert(
currentType != null
|| _target.GetType().IsCOMObject
|| targetType.IsInterface, "The class hierarchy should declare the method or be a DIM");
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,20 @@ public static IEnumerable<object[]> Create_ClosedDelegate_TestData()

IGenericInterfaceForDiagnosticMethodInfoTests<object> og = new GenericClassForDiagnosticMethodInfoTests<object>();

// Making this work with CoreCLR tracked in https://github.com/dotnet/runtime/issues/103268
if (PlatformDetection.IsMonoRuntime || PlatformDetection.IsNativeAot)
// Making this work with native AOT tracked in https://github.com/dotnet/runtime/issues/103219
if (!PlatformDetection.IsNativeAot)
{
// Making this work with native AOT tracked in https://github.com/dotnet/runtime/issues/103219
if (!PlatformDetection.IsNativeAot)
{
yield return new object[] {
(Action)og.NonGenericDefaultMethod,
nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.NonGenericDefaultMethod) ,
TestNamespace + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>) + "`1"
};
}
yield return new object[] {
(Action)og.GenericDefaultMethod<object>,
nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.GenericDefaultMethod),
(Action)og.NonGenericDefaultMethod,
nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.NonGenericDefaultMethod) ,
TestNamespace + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>) + "`1"
};
}
yield return new object[] {
(Action)og.GenericDefaultMethod<object>,
nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.GenericDefaultMethod),
TestNamespace + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>) + "`1"
};
yield return new object[] {
(Action)og.NonGenericMethod,
TestNamespace + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>) + "<T>." + nameof(IGenericInterfaceForDiagnosticMethodInfoTests<object>.NonGenericMethod),
Expand Down
Loading