dotnet / dotnet/vblang

Calling parameterless delegate properties: No need for the extra empty parenthesis

Open
#529 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

```VB.NET
Public ReadOnly Property Prop1 As Action(Of Integer, Integer)
Get
If _Prop1 Is Nothing Then _Prop1 = …
Return _Prop1
End Get

End Property
```

This property can be used like this:
`Call Prop1()(3, 4)`

I see no need for the `()` as the property has no param, and VB can realize these are the params sent to the returned Action.
`Call Prop1(3, 4)`

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.