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

Inference failure for tuple type vs tuple underlying type (regression) #20583

Closed
gafter opened this issue Jun 30, 2017 · 4 comments
Closed

Inference failure for tuple type vs tuple underlying type (regression) #20583

gafter opened this issue Jun 30, 2017 · 4 comments
Assignees
Labels
Area-Compilers Blocked Bug New Language Feature - Tuples Tuples Tenet-Compatibility Violation of forwards/backwards compatibility in a design-time piece.
Milestone

Comments

@gafter
Copy link
Member

gafter commented Jun 30, 2017

The following correct program compiles successfully in VS2015, but fails to compile in VS2017:

using System;
public class C
{
    public static void Main()
    {
        // var b = (1, 2, 3, 4, 5, 6, 7, 8);
        var b = new ValueTuple<int, int, int, int, int, int, int, ValueTuple<int>>(1, 2, 3, 4, 5, 6, 7, new ValueTuple<int>(8));
        M1(b);
    }
    public static void M1<T1, T2, T3, T4, T5, T6, T7, TRest>(ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> a) where TRest : struct { Console.Write(1); }
}

with the following error

Error CS0411: The type arguments for method 'C.M1<T1, T2, T3, T4, T5, T6, T7, TRest>(ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
@gafter gafter added Area-Compilers Bug Tenet-Compatibility Violation of forwards/backwards compatibility in a design-time piece. labels Jun 30, 2017
gafter added a commit to gafter/roslyn that referenced this issue Jun 30, 2017
@gafter
Copy link
Member Author

gafter commented Jun 30, 2017

A regression test is being added for this (skipped) in #20587.

@gafter
Copy link
Member Author

gafter commented Jul 3, 2017

I did not test whether or not this bug is present for VB.

@gafter gafter added this to the 15.5 milestone Jul 3, 2017
gafter added a commit that referenced this issue Jul 9, 2017
@gafter
Copy link
Member Author

gafter commented Jul 13, 2017

This bug is present for VB as well. The following program compiles in earlier versions of VS, but not in VS 2017.

Public Class C
    Public Shared Sub Main()
        Dim b = New ValueTuple(Of Integer, Integer, Integer, Integer, Integer, Integer, Integer, ValueTuple(Of Integer))()
        M1(b)
    End Sub
    Public Shared Sub M1(Of T1, T2, T3, T4, T5, T6, T7, TRest As Structure)(x As ValueTuple(Of T1, T2, T3, T4, T5, T6, T7, TRest))
    End Sub
End Class

@gafter
Copy link
Member Author

gafter commented Aug 10, 2017

This would likely be fixed as a side-effect of #20648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Blocked Bug New Language Feature - Tuples Tuples Tenet-Compatibility Violation of forwards/backwards compatibility in a design-time piece.
Projects
None yet
Development

No branches or pull requests

2 participants