Skip to content

Comment on First C# 7 Design Meeting Notesparent

Comments

C# has anonymous types, which are closer to records, but there's no way to refer to a particular type structure.

So while I can write

    var x = { FirstName = "Riff", LastName = "Raff" }
and then go ahead and access x.FirstName and x.LastName, I can't declare a method signature like this:
    void Display({ string FirstName, string LastName } nameRecord)
    {
    }
This is the kind of thing which is being proposed (along with possible pattern matching/decomposition syntax which is new ground for C#)
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.