XS0102 error: The type 'XXXX' already contains a definition for 'YYYY'

This forum is meant for questions and discussions about the X# language and tools
Post Reply
alex_schmitt
Posts: 85
Joined: Wed Jan 23, 2019 7:54 pm
Location: Germany

XS0102 error: The type 'XXXX' already contains a definition for 'YYYY'

Post by alex_schmitt »

Hi all,

after using VoXPorter I get tons of errors "XS0102: The type 'XXXX' already contains a definition for 'YYYY'"

Interestingly enough, I did not find any resolution in the documents nor in the forum.

I have a lot of PROTECT variables in my classes that I access and assign as follows:

Code: Select all

CLASS A
PROTECT VarA

ACCESS VarA
return self:VarA

Assign VarA(value)
self:VarA:=value

Of course I can refactor and create getters and setters as follows:

Code: Select all


ACCESS getVarA
return self:VarA

Assign setVarA(value)
self:VarA:=value
But before I do that I wanted to double check that this is the only option as this is pretty error-prone and exhausting when I am doing that in VO.

Any thoughts would be helpful :)

Best,
Alex
User avatar
robert
Posts: 4522
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

XS0102 error: The type 'XXXX' already contains a definition for 'YYYY'

Post by robert »

Alex,
From which version of VO are you coming.
VO 2.8 should have already warned you for that.
There is an option in the VOXPorter to detect this. This option will prefix the protected variable with an underscore IIRC.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
alex_schmitt
Posts: 85
Joined: Wed Jan 23, 2019 7:54 pm
Location: Germany

XS0102 error: The type 'XXXX' already contains a definition for 'YYYY'

Post by alex_schmitt »

Hi Robert,

wow the speed you guys are responding is truely amazing.

Yes, the "CheckForIVarAndPropertyConflicts" flag did the trick! I am using 2.8 SP4 Build 2838. I assume there was a warning but I did not take it serious.

Best,
Alex
Post Reply