Skip to content
Discussion options

You must be logged in to vote

This type of scenario was intentionally not (no pun intended) considered. Lowercase type names are bad style in C#, and while we make every effort to not break this type of scenario, it can happen (for example, in C# 9, putting record foo; in a type always means generate a record named foo, regardless of whether there is a type also named record). For your scenario, escaping with @ works:

object o = null;
_ = o is @not;

public class not
{
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AnakinRaW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants