Compiler Error C3155
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

Compiler Error C3155

Error Message

attributes are not allowed in a property indexer

An indexed property was declared incorrectly. For more information, see How to: Use Indexed Properties.


The following sample generates C3155.

// C3155.cpp
// compile with: /clr /c
using namespace System;
ref struct R {
   property int F[[ParamArray] int] {   // C3155
   // try the following line instead
   // property int F[ int] {   // OK
      int get(int i) { 
         return 0; 
© 2016 Microsoft