Compiler Error CS1733
Expected expression.
This error is produced whenever the compiler is expecting an expression on the line where the error occurred. In the following example, the trailing comma in the initializer indicates to the compiler that another expression will follow.
To correct this error
Provide the missing expression.
Remove the tokens that are causing the compiler to expect an expression.
Example
The following example produces CS1733 because of the trailing comma:
// cs1733.cs
using System.Collections.Generic;
public class Test
{
public static void Main()
{
List<int> list = new List<int>() {{ 1, 2, }};// CS1733
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for