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

Curiously recurring pattern when abstracted through interfaces does not work #55361

Closed
davidwrighton opened this issue Jul 8, 2021 · 2 comments
Assignees
Labels
untriaged New issue has not been triaged by the area owner

Comments

@davidwrighton
Copy link
Member

Description

The following application when loaded using .NET 6.0 does not function. In particular, it will spin forever, and not finish.

using System;
using System.Collections.Generic;
using System.Collections;

namespace CuriouslyRecurringPatternThroughInterface
{
    interface IGeneric<T_IGeneric>
    {
    }
    interface ICuriouslyRecurring<T_ICuriouslyRecurring> : IGeneric<CuriouslyRecurringThroughInterface<T_ICuriouslyRecurring>>
    {
    }
    class CuriouslyRecurringThroughInterface<T_CuriouslyRecurringThroughInterface> : ICuriouslyRecurring<T_CuriouslyRecurringThroughInterface>
    {
    }

    class Program
    {
        static object _o;
        static int Main(string[] args)
        {
            // Test that the a generic using a variant of the curiously recurring pattern involving an interface can be loaded.
            _o = typeof(CuriouslyRecurringThroughInterface<int>);
            return 100;
        }
    }
}

Configuration

.NET 6, after PR #54588

Regression?

Yes.

@davidwrighton davidwrighton self-assigned this Jul 8, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jul 8, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@davidwrighton
Copy link
Member Author

This is a duplicate of #55323

@ghost ghost locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant