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

Tuple reference compiles without System.Runtime.dll #14267

Closed
cston opened this issue Oct 4, 2016 · 3 comments
Closed

Tuple reference compiles without System.Runtime.dll #14267

cston opened this issue Oct 4, 2016 · 3 comments
Assignees
Labels
Area-Compilers Bug New Language Feature - Tuples Tuples Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@cston
Copy link
Member

cston commented Oct 4, 2016

The following compiles successfully without System.Runtime.dll and the tuple is treated as a class type: csc -t:library -r:System.ValueTuple.dll c.cs

class C
{
    static void M()
    {
        var o = (1, 2);
    }
}
@AlekseyTs
Copy link
Contributor

Here is a unit-test:

        [Fact]
        public void Test()
        {
            var text = "public struct A {}";
            var compilation1 = CreateCompilationWithMscorlib(text, options: TestOptions.ReleaseDll);

            var compilation2 = CreateCompilation(@"
class Program
{
static void Main(A x) {}
}", options: TestOptions.ReleaseDll, references: new[] { compilation1.EmitToImageReference() } );

            //compilation2.VerifyEmitDiagnostics();

            var a = compilation2.GetTypeByMetadataName("A");

            Assert.True(a.BaseType.IsErrorType());
            Assert.Equal("System.ValueType[missing]", a.BaseType.ToTestDisplayString());
            Assert.Null(a.GetUseSiteDiagnostic());
            Assert.Equal(TypeKind.Struct, a.TypeKind);
        }

a.TypeKind erroneously reports TypeKind.Class, but has no use-site error.

@gafter gafter added the Bug label Oct 6, 2016
@gafter gafter added this to the 2.0 (RC) milestone Oct 6, 2016
@gafter
Copy link
Member

gafter commented Oct 6, 2016

@cston I suspect this is already fixed in #14161?

@cston
Copy link
Member Author

cston commented Oct 6, 2016

@gafter No, this issue was discovered from #14161.

@jaredpar jaredpar modified the milestones: 2.0 (RC), 2.0 (RC.2) Oct 28, 2016
@AlekseyTs AlekseyTs self-assigned this Nov 2, 2016
AlekseyTs added a commit to AlekseyTs/roslyn that referenced this issue Nov 4, 2016
AlekseyTs added a commit to AlekseyTs/roslyn that referenced this issue Nov 7, 2016
AlekseyTs added a commit to AlekseyTs/roslyn that referenced this issue Nov 7, 2016
@cston cston added 4 - In Review A fix for the issue is submitted for review. and removed 3 - Working labels Nov 7, 2016
@AlekseyTs AlekseyTs added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug New Language Feature - Tuples Tuples Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

5 participants