dotnet / dotnet/vblang

Allow With Enum, and With Class that has some shared members

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

Description

I have a class named MyFlag with some static methods (and other non-static methods). Suppose I am using this code:
```VB.NET
Dim flag = MyFlag.X
flag += MyFlag.Y
flag = flag Xor MyFlag.Z
```

I tried to do this:
```VB.NET
With MyFlag
Dim flag =.X
flag +=.Y
flag = flag Xor .Z
End With
```

But got the error:
> 'MyFlag' is a class type and cannot be used as an expression.

So, I suggest to allow using classes that have some Static members in `With` block. This should also include enums.

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.