[progress Communities] [progress Openedge Abl] Forum Post: Incompatible Data Types In...

  • Thread starter Thread starter dbeavon
  • Start date Start date
Status
Not open for further replies.
D

dbeavon

Guest
Anyone ever see this type of error? It is a compiler-related message I saw today while running some OO code. ** Incompatible data types in expression or assignment. (223) ** ./app/Production/Treating/ScannedCharges/TreatingCharge.cls Could not understand line 147. (196) RETURN statement in user defined function or method 'NewCreateChargeOperation' is not type compatible with the function or method definition. (2782) ** ./app/Production/Treating/ScannedCharges/TreatingCharge.cls Could not understand line 148. (196) ** Incompatible data types in expression or assignment. (223) ** ./app/Production/Treating/ScannedCharges/TreatingCharge.cls Could not understand line 162. (196) Could not locate method 'PerformScanningOperation' with matching signature in class 'app.Production.Treating.ScannedCharges.MobileOps.CreateChargeOperation'. (14457) ** ./app/Production/Treating/ScannedCharges/TreatingCharge.cls Could not understand line 379. (196) As near as I can tell, these are 100% bogus errors saying my OO types are incompatible. For some reason I'm having difficulty pinning down a repro but it has to do with inheritance where subclasses override a method in a base class, and the OE compiler then decides that the types are not compatible, even though they are. In the example above, the compiler says it could not locate method 'PerformScanningOperation' with a matching signature but it is present. There are a number of wierd work-arounds that are as hard to explain as the original bug. For example if I have a method like so: METHOD PRIVATE app.Production.Treating.ScannedCharges.MobileOps.CreateChargeOperation NewCreateChargeOperation(INPUT p_BranchCode AS CHARACTER): DEFINE VARIABLE v_Operation AS CreateChargeOperation NO-UNDO. v_Operation = NEW app.Production.Treating.ScannedCharges.MobileOps.CreateChargeOperation(p_BranchCode). RETURN v_Operation. END METHOD. ... Then the fix may be to change the DEFINE VARIABLE statement to (fully qualified class name): DEFINE VARIABLE v_Operation AS app.Production.Treating.ScannedCharges.MobileOps.CreateChargeOperation NO-UNDO. Then the compiler appears happy for a little while longer, but eventually chokes somewhere else. Things get even more weird when I tried to isolate the problem. It started in a state-reset appserver session on HP-UX IA64 on version 11.6.3.013. It totally goes away if I *compile* all the source to r-code before trying to use it It goes away if I switch from state-reset to state-free (even if I delete r-code again) It goes away if I try running the code in the editor (even if I delete r-code) It goes away if I delete r-code and move to Windows 64 (things work on state-reset and state free) So the problem seems to be specific to using an OO inherited class (1) on HP-UX (2) without compiling r-code first, and (3) only in state-reset appservers. Any tips would be appreciated from those of you who are trying to use OO in ABL.

Continue reading...
 
Status
Not open for further replies.
Back
Top