-
Notifications
You must be signed in to change notification settings - Fork 3.8k
typeof(object).GetMember("") does not return an empty array #16010
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
Comments
@slozier is it regression? /cc @steveisok |
@marek-safar I believe so since our test just started failing in CI recently. I tried with 5.20.1.34 and it returns an empty array. With the latest .NET Framework and .NET Core we also get an empty array. |
#11003 likely did it. Reason being, the prefix check falls through to: And since it's an empty string, that check returns true and it'll think it can pluck from the array the runtime gave it. Which, in this case it's the default constructor method. |
After some more review, looks like I was wrong. I'm not sure how far back this goes. In this method: The callers expect null to equal "*". The problem is that we are treating "" the same. I'll have a PR ready in the morning. |
mono#16010 The current behavior for GetConstructorCandidates when the name is null, "", or "*" is to return the set of constructors for the type. For "", .NET Core and .NET Framework return 0 elements. This PR adds a check for "" to match that behavior.
mono#16010 The current behavior for GetConstructorCandidates when the name is null, "", or "*" is to return the set of constructors for the type. For "", .NET Core and .NET Framework return 0 elements. This PR adds a check for "" to match that behavior.
mono#16010 The current behavior for GetConstructorCandidates when the name is null, "", or "*" is to return the set of constructors for the type. For "", .NET Core and .NET Framework return 0 elements. This PR adds a check for "" to match that behavior.
…elements. (#16109) * Fixed RuntimeType.GetConstructorCandidates("") to return 0 elements. #16010 The current behavior for GetConstructorCandidates when the name is null, "", or "*" is to return the set of constructors for the type. For "", .NET Core and .NET Framework return 0 elements. This PR adds a check for "" to match that behavior. * Removed unncessary changes * Unnecessary spaces * Made the if check a bit more readable Backport of #16054.
…elements. (#16108) * Fixed RuntimeType.GetConstructorCandidates("") to return 0 elements. #16010 The current behavior for GetConstructorCandidates when the name is null, "", or "*" is to return the set of constructors for the type. For "", .NET Core and .NET Framework return 0 elements. This PR adds a check for "" to match that behavior. * Removed unncessary changes * Unnecessary spaces * Made the if check a bit more readable
Fixed by #16054 |
Fixes: mono/mono#16010 Context: mono/mono#15575
Fixes: mono/mono#15261 Fixes: mono/mono#15262 Fixes: mono/mono#15263 Fixes: mono/mono#15307 Fixes: mono/mono#15575 Fixes: mono/mono#16010 Ignores `TimeZoneTest.TestCtors` on Android GMT, as `TimeZone.CurrentTimeZone.DaylightName` is an empty value. [w32socket] Translate ELOOP and ENAMETOOLONG
Changes: mono/mono@893099f...a791989 Fixes: mono/mono#16010 Context: mono/mono#15575
Changes: mono/mono@761220d...a791989 Fixes: mono/mono#15261 Fixes: mono/mono#15262 Fixes: mono/mono#15263 Fixes: mono/mono#15307 Fixes: mono/mono#15575 Fixes: mono/mono#15751 Fixes: mono/mono#15825 Fixes: mono/mono#15878 Fixes: mono/mono#15887 Fixes: mono/mono#16010 Context: mono/mono#9621 Context: http://build.azdo.io/2927809 Fix `Socket.ConnectAsync(SocketAsyncEventArgs)` behavior Ignores `TimeZoneTest.TestCtors` on Android GMT, as `TimeZone.CurrentTimeZone.DaylightName` is an empty value. [w32socket] Translate ELOOP and ENAMETOOLONG Additionally, mono cross compilers are now always 64-bit, as are the LLVM runtimes. 64-bit cross-compilers broke the xamarin-android build, as it was using a 32-bit `strip` on them, which failed. Use the correct `strip` utility, and remove the reference to a Windows 32bit LLVM runtime which no longer exists. The mono archive also no longer contains any `llvmwin32` content, so ensure that the correct LLVM runtimes are installed.
Might be caused by the change in #11003?
Steps to Reproduce
Current Behavior
The array contains
.ctor
so theLength
is 1.Expected Behavior
The array should be empty?
On which platforms did you notice this
[ ] macOS
[x] Linux
[ ] Windows
Version Used:
Mono JIT compiler version 6.0.0.313 (tarball Sun Jul 14 09:57:59 UTC 2019)
The text was updated successfully, but these errors were encountered: