Nested methods, virtual constructor and class of

IDE: Visual Studio 2013
Version: 8.3.94.2011
Description:
See video and sample project.
Bug222.rar (2.6 MB)

namespace WPFApplication22;

interface

type

    { TGeometry }
  //TGeometryClass = public class of TGeometry;
  TGeometry = public class
  public
    constructor; virtual;
    class method FromSVG; 
    class method PathData;
  end;

implementation

  { TGeometry }
constructor TGeometry;
begin
  inherited;
end;

class method TGeometry.PathData;
var
  I, L: Integer;

  method GetNum: Integer;
  begin
  end;

  method SkipSpc;
  begin
  end;

begin
end;

class method TGeometry.FromSVG; 

  method AddPolygon(AData: Integer);
  var
    I, L: Integer;

    method GetNum: Integer;
    begin
      var Z := I;
    end;

    method SkipSpc;
    begin
      var Z := I;
    end;

    method SkipSeparator;
    begin
      SkipSpc;
      SkipSpc;  
    end;

  begin
      SkipSpc;
  end;

  method ExtractBBox(AData: Integer);
  var
    I, L: Integer;

    method GetNum: Integer;
    begin
      var Z := I;
    end;

    method SkipSpc;
    begin
      var Z := I;
    end;

  begin
      SkipSpc;
  end;

begin
end;

end.

Error 1 (E110) Ambiguous call to overloaded method “SkipSpc” C:\Mis archivos\Projects\SendaSoft\Oxygene\Bugs\Bugs 2016.06.30 - 1\WPFApplication22\WPFApplication22\Class1.pas 62 7 WPFApplication22

Error 4 (E46) Unknown identifier “I” C:\Mis archivos\Projects\SendaSoft\Oxygene\Bugs\Bugs 2016.06.30 - 1\WPFApplication22\WPFApplication22\Class1.pas 47 16 WPFApplication22

Best regards,
Jose A.

Having multiple nested methods with the same name inside the same method is not a scenario we support (or want to support).

Carlo,
The nested methods with the same name are in different methods.
Have you wanted to say within the same class?
This would work perfectly in Delphi.
The strange thing is that if the constructor is not virtual everything works perfectly, however, if the constructor is virtual or there is a defined “class of” of this class then and only then does not work.
Please look at the video for a better understanding.

Thanks, logged as bugs://75564

Low priority.

bugs://75564 got closed with status fixed.

Thanks Carlo.

Carlo,
In version 8.4.96.2019 this error was fixed, however, in the latest version 8.3.94.2021 this error reappears.
Best regards,
Jose A.

Yes. 8.3 is an old branch, up for release soon. 8.4 is the beta.

We thought that the only difference between betas 8.3 and 8.4 was support Island and Gotham, but errors were fixed in both branches.

Some other stuff was also done in the betas only, especially when it had far reaching code changes.

Then, for error fixes, we just have to download the 8.4 branch?

Yes. You need the 8.4 branch for these fixes.

Logged as bugs://i63531.

bugs://i63531 was closed as fixed.