Project

General

Profile

Bug #3322

Functions with names that differ only by hypenation and case are translated to non-compilable code

Added by Jaroslaw Haziak almost 7 years ago. Updated almost 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
08/12/2017
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version:

History

#1 Updated by Jaroslaw Haziak almost 7 years ago

Example:

DEF INPUT PARAM inParam AS CHAR NO-UNDO.
DEF OUTPUT PARAM ouResult AS CHAR NO-UNDO.

FUNCTION test-func RETURNS CHAR:
  RETURN 'test1'.
END.

FUNCTION testFunc RETURNS CHAR:
  RETURN 'test2'.
END.

ouResult = test-func() + testFunc() + inParam.

The two functions are translated to two Java methods with the same names, which makes the code non-compilable:

   public character testFunc()
   {
      return function("test-func", character.class, new Block((Body) () -> 
      {
         returnNormal("test1");
      }));
   }

   public character testFunc()
   {
      return function("testFunc", character.class, new Block((Body) () -> 
      {
         returnNormal("test2");
      }));
   }

The same problem probably applies to procedures and mix of a procedure and a function.

Also available in: Atom PDF