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

Check if generic types encode its arity when using GetDisplayName #1438

Merged
merged 1 commit into from
Aug 24, 2020

Conversation

mateoatr
Copy link
Contributor

@mateoatr mateoatr commented Aug 18, 2020

We currently assume that generic type names always encode its arity in the IL, whereas the ECMA explicitly states that both the grave accent and arity are optional.

Fixes #1435 and #1448

@vitek-karas
Copy link
Member

Did you find a repro for this, or is it more of a theoretical thing?
I'm not questioning the fix, I'm trying to figure out if this is something we should try to take for .NET 5, or if it can wait for later release.

@mateoatr
Copy link
Contributor Author

Did you find a repro for this, or is it more of a theoretical thing?

I opened this because of #1435, although I couldn't repro it in my machine (hitting other issues before getting to this one).

@MichalStrehovsky
Copy link
Member

I opened this because of #1435, although I couldn't repro it in my machine (hitting other issues before getting to this one).

Could the undecorated thing be reachable for non-generic nested types nested under a generic type?

class Gen<T>
{
    // This one is "A" with one generic parameter ("inherited" from the containing type)
    class A { }

    // This one is "B`1", with two generic parameters (one is "inherited" from the containing type)
    class B<U> { }
}

@mateoatr
Copy link
Contributor Author

I'm trying to figure out if this is something we should try to take for .NET 5, or if it can wait for later release.

Based on #1435 and #1448, I think we should take it for .NET 5.

@vitek-karas
Copy link
Member

OK - can you please prepare a PR to port this to the 5 release branch as well?

@marek-safar marek-safar merged commit cefde0a into dotnet:master Aug 24, 2020
mateoatr added a commit to mateoatr/linker that referenced this pull request Aug 24, 2020
tkapin pushed a commit to tkapin/runtime that referenced this pull request Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IL1012: Unhandled exception. System.ArgumentOutOfRangeException: Length cannot be less than zero
4 participants