Fri May 27, 2022 3:27 pm
Login Register Lost Password? Contact Us


Error: assert(areTypesComparable(leftType,rightType)) failed

Comments and questions related to the Enterprise Control Language

Fri Jan 21, 2022 6:22 pm Change Time Zone

I get the following run time error: Error: assert(areTypesComparable(leftType,rightType)) failed - file: hqlcpp.cpp, line 4955 (605, 17)

It is directing me to the following code:
Code: Select all
r_shop5 := record
   d_shop4.id;
   d_shop4.shopper_dob;
   d_shop4.shop_date;
   d_shop4.shopped_carrier;
   d_shop4.shop_state;
   d_shop4.shop_zip;
   unsigned sum_val1 := sum(group,d_shop4.shop_val1);
   unsigned sum_val2 := sum(group,d_shop4.shop_val2);
   unsigned sum_val3 := sum(group,d_shop4.shop_val3);
   unsigned sum_val4 := sum(group,d_shop4.shop_val4);
   STRING1 val1_in := if(sum(group,d_shop4.shop_val1)>0,'Y','N');
   STRING1 val2_in := if(sum(group,d_shop4.shop_val2)>0,'Y','N');
   STRING1 val3_in := if(sum(group,d_shop4.shop_val3)>0,'Y','N');
   STRING1 val4_in := if(sum(group,d_shop4.shop_val4)>0,'Y','N');
end;
d_shop5 := table(d_shop4,r_shop5,id,shopper_dob,shop_date,shopped_carrier,shop_state,shop_zip,local);


I can remove either the block of sums or the if(sums) and it seems to work. It just doesn't like having both in the same table. I can work around this in my code, but I don't understand why it's a problem and the error message is not helping (other than the line number).
janet.anderson
 
Posts: 52
Joined: Wed Jul 17, 2013 5:31 pm

Fri Jan 21, 2022 7:06 pm Change Time Zone

Janet,

Can you try this and see if it compiles/works?
Code: Select all
r_shop5 := record
   d_shop4.id;
   d_shop4.shopper_dob;
   d_shop4.shop_date;
   d_shop4.shopped_carrier;
   d_shop4.shop_state;
   d_shop4.shop_zip;
   unsigned sum_val1 := sum(group,d_shop4.shop_val1);
   unsigned sum_val2 := sum(group,d_shop4.shop_val2);
   unsigned sum_val3 := sum(group,d_shop4.shop_val3);
   unsigned sum_val4 := sum(group,d_shop4.shop_val4);
   STRING1 val1_in := if(self.sum_val1>0,'Y','N');
   STRING1 val2_in := if(self.sum_val2>0,'Y','N');
   STRING1 val3_in := if(self.sum_val3>0,'Y','N');
   STRING1 val4_in := if(self.sum_val4>0,'Y','N');
end;
d_shop5 := table(d_shop4,r_shop5,id,shopper_dob,shop_date,shopped_carrier,shop_state,shop_zip,local);
I haven't tested this, but it's the first thing I would try.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1619
Joined: Wed Oct 26, 2011 7:40 pm

Fri Jan 21, 2022 9:50 pm Change Time Zone

if(self.sum_val1>0,'Y','N') did not work (Error: SELF cannot be used to provide a value for field 'adpf_in' (605, 36), 2316, ), but if(max(group,d_shop4.shop_val1)>0,'Y','N') does.

There is no urgency around this since there is a workaround, I just can't seem to wrap my head around why there is an issue with the original code or your proposed code.

FYI - this was a runtime error, not a compiler error.
janet.anderson
 
Posts: 52
Joined: Wed Jul 17, 2013 5:31 pm

Mon Jan 24, 2022 12:32 pm Change Time Zone

Janet,

Glad you found a workaround, but you should definitely create a JIRA ticket for this issue.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1619
Joined: Wed Oct 26, 2011 7:40 pm


Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest