Strange behavior with literal integer assignment in Visual Studio results in four unexpected compiler errors

Viewed 46

Copy this exact line and paste it into Visual Studio (i.e. don't type it out, as that will not produce the errors). It produces the four compiler errors below. I can't see any invisible characters when I paste it into, e.g., Notepad++. What is going on?

int x = ‭28452;

Here are the four compiler errors:

CS1056 Unexpected character '‭'

CS1002 ; expected

CS1525 Invalid expression term ''

CS0201 Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

1 Answers

There is a character after the = before the assignment

Related