Skip to content

Commit a9cf528

Browse files
peksproguardrex
authored andcommitted
Update nameof.md (dotnet#2146)
Fixes bad quotation marks.
1 parent 7b9a8ea commit a9cf528

File tree

1 file changed

+3
-3
lines changed
  • docs/csharp/language-reference/keywords

1 file changed

+3
-3
lines changed

docs/csharp/language-reference/keywords/nameof.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ When reporting errors in code, hooking up model-view-controller (MVC) links, fir
3939

4040
```csharp
4141
if (x == null) throw new ArgumentNullException(nameof(x));
42-
WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode
42+
WriteLine(nameof(person.Address.ZipCode)); // prints "ZipCode"
4343
4444
```
4545

@@ -116,10 +116,10 @@ nameof(c.Method2) -> "Method2"
116116
nameof(z) -> "z" // inside of Method2 ok, inside Method1 is a compiler error
117117
nameof(Stuff) = "Stuff"
118118
nameof(T) -> "T" // works inside of method but not in attributes on the method
119-
nameof(f) -> f
119+
nameof(f) -> "f"
120120
nameof(f<T>) -> syntax error
121121
nameof(f<>) -> syntax error
122-
nameof(Method2()) -> error This expression does not have a name
122+
nameof(Method2()) -> error "This expression does not have a name"
123123

124124
```
125125

0 commit comments

Comments
 (0)