rspec/rules/S2306/csharp/rule.adoc

14 lines
505 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Since C# 5.0, ``++async++`` and ``++await++`` are contextual keywords. Contextual keywords do have a particular meaning in some contexts, but can still be used as variable names. Keywords, on the other hand, are always reserved, and therefore are not valid variable names. To avoid any confusion though, it is best to not use ``++async++`` and ``++await++`` as identifiers.
== Noncompliant Code Example
----
int await = 42; // Noncompliant
----
== Compliant Solution
----
int someOtherName = 42;
----