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

Pointer to generic Type are not allowed. #1649

Closed
jkotas opened this issue Jun 19, 2018 · 4 comments
Closed

Pointer to generic Type are not allowed. #1649

jkotas opened this issue Jun 19, 2018 · 4 comments

Comments

@jkotas
Copy link
Member

jkotas commented Jun 19, 2018

From @Neo-Ciber94 on June 19, 2018 16:44

Is impossible to declare pointers to generic types, .NET 7.3

    public struct Unmanaged<T> where T: unmanaged { }

    public unsafe struct SomeCoolAndSexyStruct<T> where T: unmanaged
    {
            public Unmanaged<T>* _pointer; //Not allowed
    }

Copied from original issue: dotnet/coreclr#18547

@jkotas
Copy link
Member Author

jkotas commented Jun 19, 2018

This is C# language limitation.

@svick
Copy link
Contributor

svick commented Jun 19, 2018

This looks like a duplicate of #1504.

@dzmitry-lahoda
Copy link

dzmitry-lahoda commented Sep 9, 2018

I got from pointers to wrongly reported error in safe code here https://stackoverflow.com/questions/52228109/a-generic-construct-requires-that-the-type-cellt-is-an-unmanaged-type

@YairHalberstadt
Copy link
Contributor

Closing as championed in #1937 and implemented in C# 8

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

No branches or pull requests

4 participants