-
Notifications
You must be signed in to change notification settings - Fork 1k
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 "tuple projection initializers" (C# 7.1, VB 15.3) #415
Comments
Can you please fix the link in https://github.com/dotnet/roslyn/blob/master/docs/Language%20Feature%20Status.md when the proposal is added? |
@NickCraver Will do. I think the link will actually be correct, but I need to write the document. |
I have run into an issue with this feature in Preview 7.0 of VS2017 Update 3. Consider the following example code: public static void Foo()
{
(T1, T2) Bar<T1, T2>((T1, T2) value) => value;
var tuple = (a:1, b:2);
var newTuple = Bar(tuple);
var a = newTuple.a;
} I get an error, " When it comes to generics, this tuple name inference appears to be limited to having to express the whole tuple as, eg public static void Foo()
{
T Bar<T>(T value) => value;
var tuple = (a:1, b:2);
var newTuple = Bar(tuple);
var a = newTuple.a;
} then the code compiles. But then, my Is this a bug/oversight, or is what I want to do completely outside the scope of this new feature? |
I think that behavior is correct. In your first example |
I think you are right: it's not a bug. It's a (very necessary, for me at least) extension to this feature. As it stands, if I method-chain with I shall create a new proposal issue therefore. |
See also #370
A working implementation is at dotnet/roslyn#18374
The text was updated successfully, but these errors were encountered: