Skip to content

Commit 593f88e

Browse files
shethaaditAdit Sheth
andauthored
Fix invalid comment example in Snippet24 by replacing it with a valid expression statement (#46378)
* Fixed bug 46309. * Initialize x. --------- Co-authored-by: Adit Sheth <[email protected]>
1 parent 37fd367 commit 593f88e

File tree

1 file changed

+3
-2
lines changed
  • samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideStatements/CS

1 file changed

+3
-2
lines changed

samples/snippets/csharp/VS_Snippets_VBCSharp/csProgGuideStatements/CS/Statements.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,9 @@ void TestMethod(string s)
535535
// Expression statement (assignment).
536536
area = 3.14 * (radius * radius);
537537

538-
// Error. Not statement because no assignment:
539-
//circ * 2;
538+
// Expression statement (result discarded).
539+
int x = 0;
540+
x++;
540541

541542
// Expression statement (method invocation).
542543
System.Console.WriteLine();

0 commit comments

Comments
 (0)