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

Champion: Unmanaged constructed types (16.3, Core 3) #1937

Open
4 tasks done
agocke opened this issue Oct 18, 2018 · 18 comments
Open
4 tasks done

Champion: Unmanaged constructed types (16.3, Core 3) #1937

agocke opened this issue Oct 18, 2018 · 18 comments
Assignees
Labels
Implemented Needs ECMA Spec This feature has been implemented in C#, but still needs to be merged into the ECMA specification Proposal champion
Milestone

Comments

@agocke
Copy link
Member

agocke commented Oct 18, 2018

@xoofx
Copy link
Member

xoofx commented Jan 4, 2019

@agocke hey, any news on this? We are getting seriously blocked by this at Unity and this is becoming more urgent. How can we help to push for this?

@xoofx
Copy link
Member

xoofx commented Jan 4, 2019

A few questions:

  • Is there any other changes to the spec than what I described here?
  • Prototype/Implementation wise, can you confirm that it should be fairly easy to fix this in Roslyn? (apart unlocking the check and adding some tests related to this?)

@agocke
Copy link
Member Author

agocke commented Jan 4, 2019

@xoofx This has been approved and @RikkiGibson is almost done with his implementation. Expected release: C# 8.0 😄

@agocke agocke added this to the 8.0 candidate milestone Jan 4, 2019
@xoofx
Copy link
Member

xoofx commented Jan 4, 2019

@xoofx This has been approved and @RikkiGibson is almost done with his implementation. Expected release: C# 8.0

Cool! Is it accessible in a branch?

@agocke
Copy link
Member Author

agocke commented Jan 4, 2019

@xoofx Just linked to the branch.

@xoofx
Copy link
Member

xoofx commented Jan 4, 2019

yep, just saw that, 😅 thanks!

@abelbraaksma
Copy link

@agocke, for reference, maybe it's better to link to the PR directly? I believe it's this one: dotnet/roslyn#31148

@PathogenDavid
Copy link

There's sometimes more than one PR for each feature branch. For instance: dotnet/roslyn#31597 also applies to this feature.

When you look at the commits in the branch, you can see the pull requests there: https://github.com/dotnet/roslyn/commits/features/unmanaged-constructed-types So if you want to read the code reviews and such, you're probably best off going through there.

@abelbraaksma
Copy link

@PathogenDavid, thanks, that helps :)

@hypeartist
Copy link

Hmmm... Seems like the link (https://github.com/dotnet/roslyn/commits/features/unmanaged-constructed-types) is outdated? It gives me 404 error.

@PathogenDavid
Copy link

It was merged into the dev16.1-preview1 branch.

Based on dotnet/roslyn#31374 (comment), I think development on feature is considered to have been completed.

@RikkiGibson
Copy link
Contributor

Sorry, I forgot to check the box for "implementation" :)

Yes, the feature is now in Roslyn's master branch. It won't ship until dev16.1-preview1.

@dzmitry-lahoda
Copy link

dzmitry-lahoda commented Mar 7, 2019

    public interface IEntity<TId>
        where TId : unmanaged
    {
        TId Id { get; }
    }
   public interface ISkill : IEntity<(byte, byte)>
   {
   }
Severity	Code	Description	Project	File	Line	Suppression State
Error	CS8377	The type '(byte, byte)' must be a non-nullable value type, along with all fields at any level of nesting, in order to use it as parameter 'TId' in the generic type or method 'IEntity<TId>'	

ValueTuple<T1,T2> has no where T1 : unmanaged where T2 : unmanaged. But in case presented it seems unmanaged.

Will(can) ValueTuple be supported as part of implementation?

As broader picture, I am writing serialization engine SergeyTeplyakov/ObjectLayoutInspector#15 which may support more cases, if generic structs not constrained by unmanaged at declaration side, but still closed on generics at usage side, could still be considered unmanaged.

@xoofx
Copy link
Member

xoofx commented Mar 7, 2019

@dzmitry-lahoda are you using the Roslyn dev16.1-preview1? (afaik, it is not shipped in any VS2019, you have to fetch the compiler yourself) otherwise I would expect it to work with what did @RikkiGibson

@jcouv jcouv changed the title Champion: Unmanaged constructed types Champion: Unmanaged constructed types (16.3, Core 3) Jul 18, 2019
@xoofx
Copy link
Member

xoofx commented Sep 28, 2019

This issue can be closed right?

@PathogenDavid
Copy link

PathogenDavid commented Sep 28, 2019

@xoofx Not saying it isn't a little weird, but the champion issues for completed C# features are never closed. (See comments here, or here by @gafter)

@HaloFour
Copy link
Contributor

@xoofx

IIRC the issue is kept open until the spec and doc work is also complete.

@xoofx
Copy link
Member

xoofx commented Sep 28, 2019

Oh, ok thanks, sorry for the noise 😅

@333fred 333fred added the Implemented Needs ECMA Spec This feature has been implemented in C#, but still needs to be merged into the ECMA specification label Oct 16, 2020
@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Implemented Needs ECMA Spec This feature has been implemented in C#, but still needs to be merged into the ECMA specification Proposal champion
Projects
None yet
Development

No branches or pull requests

9 participants