'__Usual.operator &(__Usual, __Usual)' .. short circuit operator, ...

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
ArneOrtlinghaus
Posts: 384
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

'__Usual.operator &(__Usual, __Usual)' .. short circuit operator, ...

Post by ArneOrtlinghaus »

The following expression is accepted:
(RueckString usual)
if ( islogic(RueckString) .and. Rueckstring == true)

The following expression gives the error below
if ( islogic(RueckString) .and. Rueckstring)

Error In order for '__Usual.operator &(__Usual, __Usual)' to be applicable as a short circuit operator, its declaring type '__Usual' must define operator true and operator false

Unfortunately there are many places in our old VO code. Is it necessary to change all places?

Thank you
Arne Ortlinghaus
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

'__Usual.operator &(__Usual, __Usual)' .. short circuit operator, ...

Post by robert »

Arne,

This problem is fixed in our current development branch.
If you add a cast to your code then it works in Vulcan as well:

Code: Select all

if ( islogic(RueckString) .and. (Logic) Rueckstring)
Unfortunately that cast will not work in VO.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
ArneOrtlinghaus
Posts: 384
Joined: Tue Nov 10, 2015 7:48 am
Location: Italy

'__Usual.operator &(__Usual, __Usual)' .. short circuit operator, ...

Post by ArneOrtlinghaus »

Thank you
Arne
Post Reply