Hi Thomas,
Would you please contact IBM support and open a PMR so we can get it addressed?
I'll add an Internal defect this morning that will track to the IBM APAR once it's opened.
May I use your example source in the defect tracking?
Thanks!
Steve Ferrell
-----Original Message-----
From: WDSCI-L <wdsci-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Tools/400
Sent: Wednesday, May 29, 2019 3:38 AM
To: wdsci-l@xxxxxxxxxxxxxxxxxx
Subject: [WDSCI-L] RDi 9.6.0.6 - Refactoring constants produces invalid source code
Hi,
I updated my RDi to 9.6.0.6 and tried the new "Extract constant" feature.
"Extract constant" produces invalid source code, when the name of the constant matches an existing field name.
For example:
Before:
//----------------------------------------------------------------------
// GLOBAL VARIABLES
//----------------------------------------------------------------------
// Number of assertions called.
D assertCalled s 10i 0
// Latest assertion failure event information. Can be blank if no // assertion failure event since last assertion.
D assertFailEvt ds likeds(AssertFailEvtLong_t)
//----------------------------------------------------------------------
// Assert equality between two alphanumeric variables.
//----------------------------------------------------------------------
P aEqual...
P b export
D pi
D expected 32565a const
D actual 32565a const
D fieldName 64a const varying options(*nopass: *omit)
D msg s like(msgText_t) inz
/free
if (%parms() >= 3 and %addr(fieldName) <> *NULL);
msg = %trim(fieldName) + ': ';
endif;
msg = msg
+ 'Expected ' + QUOTE + %trimr(expected) + QUOTE + ','
+ ' but was ' + QUOTE + %trimr(actual ) + QUOTE + '.';
doAssert(expected = actual: msg: ONE_CALL_STK_LVL_ABOVE: 'aEqual');
/end-free
P e
After extracting 'Expected ' to EXPECTED:
//----------------------------------------------------------------------
// GLOBAL VARIABLES
//----------------------------------------------------------------------
// Number of assertions called.
D EXPECTED C 'Expected ' // <=== Inserted line
D assertCalled s 10i 0
// Latest assertion failure event information. Can be blank if no // assertion failure event since last assertion.
D assertFailEvt ds likeds(AssertFailEvtLong_t)
//----------------------------------------------------------------------
// Assert equality between two alphanumeric variables.
//----------------------------------------------------------------------
P aEqual...
P b export
D pi
D expected 32565a const
D actual 32565a const
D fieldName 64a const varying options(*nopass: *omit)
D msg s like(msgText_t) inz
/free
if (%parms() >= 3 and %addr(fieldName) <> *NULL);
msg = %trim(fieldName) + ': ';
endif;
msg = msg
+ EXPECTED + QUOTE + %trimr(expected) + QUOTE + ','
+ ' but was ' + QUOTE + %trimr(actual ) + QUOTE + '.';
doAssert(expected = actual: msg: ONE_CALL_STK_LVL_ABOVE: 'aEqual');
/end-free
P e
The compiler error message is "RNF7421 Operands are not compatible with the type of operator." in procedure, which is stored in the same module:
//----------------------------------------------------------------------
// Assert equality between two integers.
//----------------------------------------------------------------------
P iEqual...
P b export
D pi
D expected 31s 0 const
D actual 31s 0 const
D fieldName 64a const varying options(*nopass: *omit)
D msg s like(msgText_t) inz
/free
if (%parms() >= 3 and %addr(fieldName) <> *NULL);
msg = %trim(fieldName) + ': ';
endif;
msg = msg
+ EXPECTED + %char(expected) + ','
+ ' but was ' + %char(actual ) + '.';
doAssert(expected = actual: msg: ONE_CALL_STK_LVL_ABOVE: 'iEqual');
/end-free
P e
Can somebody confirm the problem?
Regards,
Thomas.
--
This is the Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries (WDSCI-L) mailing list To post a message email: WDSCI-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/wdsci-l.
Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.