Sdílet prostřednictvím


Chyba kompilátoru C3342

'attribute': nejednoznačný atribut

Poznámky

Kompilátor zjistil více než jednu definici atributu.

Atribut byl definován více než jednou.

Další informace naleznete v tématu Uživatelem definované atributy.

Příklad

Následující příklad vygeneruje C3342.

// C3342.cpp
// compile with: /clr /c
using namespace System;
using namespace System::Reflection;

[AttributeUsage(AttributeTargets::All)]
public ref class XAttribute : public  Attribute {};

[AttributeUsage(AttributeTargets::All)]
public ref class X : public Attribute {};

[X]   // C3342 could refer to X or XAttribute
// try the following line instead
// [XAttribute]
public ref class Class4 {};