Skip to content

Commit

Permalink
Update nameof.md (dotnet#2146)
Browse files Browse the repository at this point in the history
Fixes bad quotation marks.
  • Loading branch information
pekspro authored and guardrex committed May 13, 2017
1 parent 7b9a8ea commit a9cf528
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/csharp/language-reference/keywords/nameof.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ When reporting errors in code, hooking up model-view-controller (MVC) links, fir

```csharp
if (x == null) throw new ArgumentNullException(nameof(x));
WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode
WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode"
```

Expand Down Expand Up @@ -116,10 +116,10 @@ nameof(c.Method2) -> "Method2"
nameof(z) -> "z" // inside of Method2 ok, inside Method1 is a compiler error
nameof(Stuff) = "Stuff"
nameof(T) -> "T" // works inside of method but not in attributes on the method
nameof(f) -> f
nameof(f) -> "f"
nameof(f<T>) -> syntax error
nameof(f<>) -> syntax error
nameof(Method2()) -> error This expression does not have a name
nameof(Method2()) -> error "This expression does not have a name"

```

Expand Down

0 comments on commit a9cf528

Please sign in to comment.