Skip to content

Commit

Permalink
[netcore] Fix CreateInstance_PublicOnlyValueTypeWithPrivateDefaultCon…
Browse files Browse the repository at this point in the history
…structor_T… (mono#14321)

* Fix CreateInstance_PublicOnlyValueTypeWithPrivateDefaultConstructor_ThrowsMissingMethodException

* Update excludes-System.Runtime.Tests.rsp

* Update RuntimeType.cs
  • Loading branch information
EgorBo authored and marek-safar committed May 4, 2019
1 parent 744d3b7 commit 534c688
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 4 additions & 0 deletions mcs/class/corlib/ReferenceSources/RuntimeType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ object CreateInstanceMono (bool nonPublic, bool wrapExceptions)
{
var ctor = GetDefaultConstructor ();
if (!nonPublic && ctor != null && !ctor.IsPublic) {
#if NETCORE
throw new MissingMethodException(SR.Format(SR.Arg_NoDefCTor, FullName));
#else
ctor = null;
#endif
}

if (ctor == null) {
Expand Down
17 changes: 7 additions & 10 deletions netcore/excludes-System.Runtime.Tests.rsp
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,24 @@
-nomethod System.Tests.ExitCodeTests.SigTermExitCode

# crashes runtime
-nomethod System.Tests.ArgIteratorTests.ArgIterator_Throws_PlatformNotSupportedException

# causes 'error: Return type can't be a byref type Parameter name: returnType':
# while the test passes, xunit fails in the end if it's enabled
-nomethod System.Tests.Types.VoidTests.IsByRef_Get_ReturnsExpected

# float- and double- backed enums
-nomethod System.Tests.EnumTests.Parse
-nomethod System.Tests.EnumTests.Parse_NetCoreApp11

# Implement more checks
# Implement more checks in Array.Copy
-nomethod System.Tests.ArrayTests.SetValue_Casting_Invalid
-nomethod System.Tests.ArrayTests.Copy_SZArray
-nomethod System.Tests.ArrayTests.CreateInstance_NotSupportedType_ThrowsNotSupportedException

# Missing exceptions
-nomethod System.Tests.ActivatorTests.CreateInstance_PublicOnlyValueTypeWithPrivateDefaultConstructor_ThrowsMissingMethodException
-nomethod System.Tests.ActivatorTests.CreateInstance_PrimitiveWidening_ThrowsInvalidCastException

# Boxed pointers are not supported? https://github.com/mono/mono/blob/ced517784b2a07fb851e2227dac04e0df2262d57/mcs/class/corlib/ReferenceSources/RuntimeType.cs#L229
-nomethod System.Reflection.Tests.InvokeRefReturnNetcoreTests.TestByRefLikeRefReturn

# `private new T Foo` doesn't hide members from Type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)
-nomethod System.Reflection.Tests.TypeTests_HiddenTestingOrder.HideDetectionHappensBeforeBindingFlagChecks

# IEEE rounding issues
# remove once CoreFX gets https://github.com/dotnet/coreclr/pull/24279
-nomethod System.Tests.TimeSpanTests.FromMilliseconds
-nomethod System.Tests.TimeSpanTests.FromMilliseconds_Invalid
-nomethod System.Tests.TimeSpanTests.Multiplication
Expand All @@ -81,3 +75,6 @@
-nomethod System.Runtime.CompilerServices.Tests.ConditionalWeakTableTests.Add
-nomethod System.Runtime.CompilerServices.Tests.ConditionalWeakTableTests.GetValue
-nomethod System.Tests.ActivatorTests.TestingCreateInstanceObjectHandleFullSignature
-nomethod System.Tests.EnumTests.Parse
-nomethod System.Tests.EnumTests.Parse_NetCoreApp11
-nomethod System.Tests.ArgIteratorTests.ArgIterator_Throws_PlatformNotSupportedException

0 comments on commit 534c688

Please sign in to comment.