Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Implicitly typed locals cannot have multiple declarators.
Multiple declarators are allowed in explicit type declarations, but not with implicitly typed variables.
To correct this error
- Declare and assign a value to each implicitly typed local variable on a separate line.
Example
The following code generates CS0819:
// cs0819.cs
class A
{
public static int Main()
{
var a = 3, b = 2; // CS0819
return -1;
}
}