dotnet / vblang

The home for design of the Visual Basic .NET programming language and runtime library.
290 stars 66 forks source link

Auto-implemented Property with Identified backing Field #236

Open ghost opened 6 years ago

ghost commented 6 years ago

While I'm writing this property:

    Public Property NewYork() As Integer
        Get
            Return Me("NewYork")
        End Get
        Set
            Me("NewYork") = Value
        End Set
    End Property

I asked myself: Why can't it be auto-implemented?

So, could it be like this: Public Property NewYork(Me("NewYork")) As Integer

Or like this:

Public Property NewYork() As Integer {Me("NewYork")}

This is not only for dictionary keys. It's general for any property that uses an existing object instead of a backing filed

Public Property Prop1(Storage) As Integer

Or:

Public Property Prop1() As Integer {Storage}

I hope to hear other syntax suggestions.

ghost commented 5 years ago

??

pricerc commented 5 years ago

I think it's covered by #61