Icon View Incident Report

Serious Serious
Reported By: Michael Dreher
Reported On: 7/27/2017
For: Version 2.06 Build 5
# 4570 Compiler Not Resolving Function Reference Properly When Overloaded Function Declared After Reference

I've declared classes and overloaded functions

The JS output is

 // cells_tcelliterator.$p.reset = function()
 // {
 //    var $t = this, i;
 //    i = (3 > 0, 0, -1); // (*)
 // };

(*) is valid JavaScript; an assignment to a comma operator expression resulting to -1. But I expected an assignment to the return value of a function call. The function name is missing here.

The IFF functions are implemented in different units. When I merge both functions into a single unit, the JS output is correct.

 // type TCell = class end;
 //      TCellIterator = class public procedure Reset; end;
 // 
 // function IFF(condition : boolean; const c1, c2 : TCell) : TCell; 
 // function IFF(condition : boolean; i1, i2 : integer) : integer;

and applied the IFF function

 // procedure TCellIterator.Reset;
 // var i : integer;
 // begin                          
 //   i := IFF(3 > 0, 0, -1);
 // end;

The JS output is 

 // cells_tcelliterator.$p.reset = function()
 // {
 //    var $t = this, i;
 //    i = (3 > 0, 0, -1); // (*)
 // };



Comments Comments and Workarounds
This was a compiler resolution bug. The workaround was to move the function implementation *before* the reference to the function in the same unit.


Resolution Resolution
Fixed Problem on 7/29/2017 in version 2.06 build 6


Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial

Image