krfkeith / la-pe

Automatically exported from code.google.com/p/la-pe
0 stars 0 forks source link

Writeln of a pointer to a type with a pointer to its same type gives duplicate declaration #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you create a custom type with a field which is a pointer to the same type, 
trying to Writeln a pointer to your type will produce a Duplicate declaration 
error, but only if you haven't already printed your type using Writeln.

Example code:
type
  PMyType = ^MyType;
  MyType = record
    toast: PMyType;
  end;

var
  myVar: PMyType;
begin
  New(myVar);
  //Writeln(myVar^); // Doesn't throw error if uncommented
  Writeln(myVar); // Throws error
end.

Uncommenting the line and leaving the second Writeln in results in the script 
running to completion without a problem.

Original issue reported on code.google.com by mixste...@gmail.com on 14 Mar 2012 at 8:58

GoogleCodeExporter commented 9 years ago
Thanks for reporting!
Not sure what could be causing this, but will try to fix as soon as possible.

Original comment by niels....@gmail.com on 15 Mar 2012 at 6:40

GoogleCodeExporter commented 9 years ago
Should be fixed in rev. 26a32e182bdb

Original comment by niels....@gmail.com on 17 Mar 2012 at 11:09