0

For clarification, this is a bug report against the x++ compiler, not an 'idea'. There does not seem to be a dedicated location for that.


x++ seems to assume the every table has 'standard' fields, and will not raise an error if not present.


In our case, this lead to some fetch results not being ordered as expected, but consequences could be considerably more severe as it is effectively silent data corruption.


Example code:

  public static void ThisShouldNotCompile_ButDoes()

  {

    IDLookupTable idtable; // this table only contains a single ID field. Any table that does not contain one of the following fields will exhibit this behaviour


    var x = idtable.ModifiedDateTime;  // No Error is generated here, but should

    var y = idtable.CreatedDateTime;  // or here

    var z = idtable.RecId;       // or here

    var w = idtable.DataAreaId;     // or here


    while

      select idtable

      order by idtable.ModifiedDateTime // No Error is generated here, but should

    {

      int result = 4;

    }

  }


  public static void ThisShouldNotCompile_AndDoesNot()

  {

    IDLookupTable idtable; // this table only contains a single ID field


    var x = idtable.NonexistantField; // Error generated here, as expected


    while

      select idtable

      order by idtable.NonexistantField // Error generated here, as expected

    {

      int result = 4;

    }

  }

Category: Development
STATUS DETAILS
New