dotnet / dotnet/vblang

Proposal: member functions in Enums

Open
#210 5 comments 0 reactions 0 assignees View on GitHub
Proposal Scenario-Needed
Dominant language
No language data
Stars
328
Forks
71
PR merge metrics
No merged PRs in 30d

Description

At this moment, the following is not allowed:

```
Public Enum MyEnum
Value1
Value2
Value3

Public Function MyEnumFunction As String
Return "My Enum Function"
End Function
End Enum
```

But I can do the following:
```
Public Enum MyEnum
Value1
Value2
Value3
End Enum

Public Module ExtendEnum
_
Public Function MyEnumFunction(myEnum as MyEnum) As String
Return "My Enum Function"
End Function
End Module
```

Which gives the same result.
But I'd rather use the first one than misuse extensions.

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.