When I use the following code for a method I get a red squiggly line at the very end, with a message invalid expression term ')'.
But the method runs fine. Does anyone know why the error message?
public TimedMsgBox(bool isTimed = true)
{
*** some code here ***
}
Sometimes Visual Studio holds on to those errors even after they’ve already been solved for. I’ve had a number of times where I paused while constructing a method, got a red line underneath the next method in the class, finished my method, and still seeing that red line.
Try to Rebuild the solution (not just the plain build), or just restart Visual Studio. That typically gets rid of it for me.
EDIT: Or, if the squiggly lines in general bother you, just follow this advice to turn them off.