Skip to content

Latest commit

 

History

History
42 lines (36 loc) · 841 Bytes

cs0547.md

File metadata and controls

42 lines (36 loc) · 841 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Compiler Error CS0547
Compiler Error CS0547
07/20/2015
CS0547
CS0547
aa80873f-deb0-4ff2-8435-92a626bb5b80

Compiler Error CS0547

'property' : property or indexer cannot have void type

void is invalid as a return value for a property.

For more information, see Properties.

The following sample generates CS0547:

// CS0547.cs  
public class a  
{  
   public void i   // CS0547  
   // Try the following declaration instead:  
   // public int i  
   {  
      get  
      {  
         return 0;  
      }  
   }  
}  
  
public class b : a  
{  
   public static void Main()  
   {  
   }  
}