dotnet / dotnet/vblang

Allow us to use With Me on constructor with readonly variables

Open
#338 5 comments 7 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

Sometimes constructors got many variables and we have to type Me. all the time
```vb
Sub New(Value() As Object)
Me.Prop1 = Value(0)
Me.Prop2 = Value(1)
Me.Prop3 = Value(2)
.
.
.
Me.PropN = Value(N-1)
End Sub
```
I would like if we could use With Me instead, for some of us it would look better
```vb
Sub New(Value() As Object)
With Me
.Prop1 = Value(0)
.Prop2 = Value(1)
.Prop3 = Value(2)
.
.
.
.PropN = Value(N-1)
End With
End Sub
```
Currently, we can't compile as it will say that ReadOnly variables cannot be target of an assignment

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.