-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Reflection regression - Type.GetType does not skip leading .
#84644
Comments
Tagging subscribers to this area: @dotnet/area-system-reflection Issue DetailsDescription
Reproduction StepsRun the attached repro Expected behaviorNo exceptions thrown Actual behavior
Regression?Yes, this used to work on SDK 8.0.100-preview.4.23171.22 Known WorkaroundsNo response ConfigurationSDK 8.0.100-preview.4.23210.1 Other informationNo response
|
/cc @buyaa-n |
@EgorBo This is very recent regression. My guess is that it was introduced by #83911. public partial class GlobalNamespaceContextModel : RuntimeModel
{
static GlobalNamespaceContextModel()
{
var model = new GlobalNamespaceContextModel();
...
_instance = model;
}
private static GlobalNamespaceContextModel _instance;
public static IModel Instance => _instance; <- This returns null when invoked by reflection.
} |
hm.. I can't repro no matter what I do - I tried the exact SDK version + played with R2R/TC modes - it still prints "Success!" on run for me macOS-x64 13.2.1 |
@AndriySvyryd any extra steps I need to do, does it repro via |
Also tried to run it in a loop (via bash) and with various stress modes - still no luck reproing |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsDescription
Reproduction StepsRun the attached repro Expected behaviorNo exceptions thrown Actual behavior
Regression?Yes, this used to work on SDK 8.0.100-preview.4.23171.22 Known WorkaroundsNo response ConfigurationSDK 8.0.100-preview.4.23210.1 Other informationNo response
|
I have only been able to repro this on Helix machines via It doesn't repro on macOS-x64 11.7.5 Here's an updated repro that builds the target assembly at runtime. |
We also set |
Thanks! I was able to repro and investigating now |
Doesn't look to be #83911 as it still reproduces on Main when I disable that phase. Also reproduces in Debug mode + R2R=0 + JitMinOpts=1 so highly unlikely a JIT issue, still looking |
Updating Microsoft.CodeAnalysis.CSharp from 4.2.0 to 4.5.0 resolves this issue. So, it can be closed as far as we are concerned. |
I was bisecting it on locally built runtime and the regression or whatever it was is between [20..25] of march, bisecting further |
so far looks like #83484, I'll check before-after in a moment to make sure |
Steps for https://github.com/dotnet/runtime/files/11214690/ReflectionOSX.zip # I was doing this using 8.0.100-preview.4.23210.1 SDK
dotnet publish -c Release -r osx-x64 then I was just executing output binary using corerun from Checked folder
|
Tagging subscribers to this area: @dotnet/area-system-reflection Issue DetailsDescription
Reproduction StepsRun the attached repro Expected behaviorNo exceptions thrown Actual behavior
Regression?Yes, this used to work on SDK 8.0.100-preview.4.23171.22 Known WorkaroundsNo response ConfigurationSDK 8.0.100-preview.4.23210.1 Other informationNo response
|
.
@EgorBo Thank you for taking a look! The problem is in The issue is that |
Ignore leading '.' for global typenames for compatibility with earlier .NET versions. Fixes dotnet#84644
Ignore leading '.' for global typenames for compatibility with earlier .NET versions. Fixes #84644
Description
Type.GetType
does not find the type when type name starts with.
(dot)..Reproduction Steps
Expected behavior
Type is found
Actual behavior
Type is not found
Regression?
Yes, this used to work on SDK 8.0.100-preview.4.23171.22
Known Workarounds
No response
Configuration
SDK 8.0.100-preview.4.23210.1
macOS-11.6.7
x64
Other information
No response
The text was updated successfully, but these errors were encountered: