I'm getting a C2327 on something along the lines of this:
public ref class A
{
public:
virtual property String ^ DisplayName { String ^ get() override; }
[System::ComponentModel::DisplayName("Type")]
property Object ^ Type { Object ^ get(); }
};
I can't see why C2327 should apply. I'm guessing it falls into the category
explained by example b. I'm wondering why this shouldn't be allowed. Where
is the ambiguity?
This has some fairly big repurcussions if this is intentional. Does this
mean that I now have to avoid using any name as a property that might appear
as an attribute? How can I possibly know what attributes MS plans to add in
the future? What about 3rd party attributes? If I use a 3rd party library
that uses attributes, am I then supposed to go through my entire codebase
changing property names to eradicate the conflict?
Thanks,
Noah
Ben Voigt - 02 Jun 2006 16:59 GMT
> I'm getting a C2327 on something along the lines of this:
>
[quoted text clipped - 4 lines]
>
> [System::ComponentModel::DisplayName("Type")]
have you tried using DisplayNameAttribute spelled out?
> property Object ^ Type { Object ^ get(); }
> };
[quoted text clipped - 12 lines]
> Thanks,
> Noah
Noah Stein - 03 Jun 2006 03:04 GMT
>> I'm getting a C2327 on something along the lines of this:
>>
[quoted text clipped - 6 lines]
>
> have you tried using DisplayNameAttribute spelled out?
That works fine. Thanks.