rspec/rules/S2306/csharp/rule.adoc
2022-02-04 16:28:24 +00:00

34 lines
792 B
Plaintext

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
[source,csharp]
----
int await = 42; // Noncompliant
----
== Compliant Solution
[source,csharp]
----
int someOtherName = 42;
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]