[fpc-devel] Fatal: Internal error 200111022

2010-09-14 Thread Leonardo M . Ramé
Hi, does anyone knows what the error "Fatal: Internal error 200111022" means?.


Leonardo M. Ramé
http://leonardorame.blogspot.com




___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Birger Jansen
I'm not sure if this is the correct way to report this, please correct me if I 
should report in another way.

I found an old conversation between Leonardo and Florian about the Fatail 
internal error 200111022. The thread concluded that they could not reproduce 
the error.

I got this error while converting a large project from Delphi to FPC. It turns 
out that a base class has a property Count, and a derived class has a function 
with the same name Count. This will compile, untill you call the property or 
function Count. 

I created an example that should explain it. Uncomment the marked line to get 
the fatal internal error:

program project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes;

type

  TBase = class
  private
function GetCount: Integer;
  public
property Count: Integer read GetCount;
  end;

  TSub = class(TBase)
  public
function Count: Integer; overload;
  end;

function TSub.Count: Integer;
begin
  Result := 0;
end;

{ TBase }

function TBase.GetCount: Integer;
begin
  Result := 0;
end;

var
  MySub: TSub;
  i : Integer;
begin
  MySub := TSub.Create;
// uncomment the next line for Fatal Internal error 200111022:
//  for i := 0 to MySub.Count do begin end;
end.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Birger Jansen
> Can you please enter a bug-report for this, and simply mention these facts ?

Done: http://bugs.freepascal.org/view.php?id=17675
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-09-14 Thread Florian Klaempfl
Am 14.09.2010 01:13, schrieb Leonardo M. Ramé:
> Hi, does anyone knows what the error "Fatal: Internal error 200111022" means?.
> 

Something happened which should not happen ;) Looks like an error with
overloading. Can you create a cut down example?
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-09-14 Thread Leonardo M . Ramé
Sorry Florian, the error happened trying to compile some auto-generated code 
with wrong property assignments, with overloaded setters. It's fixed now.

Leonardo M. Ramé
http://leonardorame.blogspot.com


--- On Tue, 9/14/10, Florian Klaempfl  wrote:

> From: Florian Klaempfl 
> Subject: Re: [fpc-devel] Fatal: Internal error 200111022
> To: "FPC developers' list" 
> Date: Tuesday, September 14, 2010, 12:04 PM
> Am 14.09.2010 01:13, schrieb Leonardo
> M. Ramé:
> > Hi, does anyone knows what the error "Fatal: Internal
> error 200111022" means?.
> > 
> 
> Something happened which should not happen ;) Looks like an
> error with
> overloading. Can you create a cut down example?
> ___
> fpc-devel maillist  -  fpc-devel@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-09-14 Thread Florian Klämpfl
Am 14.09.2010 19:39, schrieb Leonardo M. Ramé:
> Sorry Florian, the error happened trying to compile some auto-generated code 
> with wrong property assignments, with overloaded setters. It's fixed now.

In FPC or your code?

> 
> Leonardo M. Ramé
> http://leonardorame.blogspot.com
> 
> 
> --- On Tue, 9/14/10, Florian Klaempfl  wrote:
> 
>> From: Florian Klaempfl 
>> Subject: Re: [fpc-devel] Fatal: Internal error 200111022
>> To: "FPC developers' list" 
>> Date: Tuesday, September 14, 2010, 12:04 PM
>> Am 14.09.2010 01:13, schrieb Leonardo
>> M. Ramé:
>>> Hi, does anyone knows what the error "Fatal: Internal
>> error 200111022" means?.
>>>
>>
>> Something happened which should not happen ;) Looks like an
>> error with
>> overloading. Can you create a cut down example?
>> ___
>> fpc-devel maillist  -  fpc-devel@lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>>
> 
> 
>   
> ___
> fpc-devel maillist  -  fpc-devel@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-09-14 Thread Leonardo M . Ramé
My code, don't worry.


Leonardo M. Ramé
http://leonardorame.blogspot.com


--- On Tue, 9/14/10, Florian Klämpfl  wrote:

> From: Florian Klämpfl 
> Subject: Re: [fpc-devel] Fatal: Internal error 200111022
> To: "FPC developers' list" 
> Date: Tuesday, September 14, 2010, 4:01 PM
> Am 14.09.2010 19:39, schrieb Leonardo
> M. Ramé:
> > Sorry Florian, the error happened trying to compile
> some auto-generated code with wrong property assignments,
> with overloaded setters. It's fixed now.
> 
> In FPC or your code?
> 
> > 
> > Leonardo M. Ramé
> > http://leonardorame.blogspot.com
> > 
> > 
> > --- On Tue, 9/14/10, Florian Klaempfl 
> wrote:
> > 
> >> From: Florian Klaempfl 
> >> Subject: Re: [fpc-devel] Fatal: Internal error
> 200111022
> >> To: "FPC developers' list" 
> >> Date: Tuesday, September 14, 2010, 12:04 PM
> >> Am 14.09.2010 01:13, schrieb Leonardo
> >> M. Ramé:
> >>> Hi, does anyone knows what the error "Fatal:
> Internal
> >> error 200111022" means?.
> >>>
> >>
> >> Something happened which should not happen ;)
> Looks like an
> >> error with
> >> overloading. Can you create a cut down example?
> >> ___
> >> fpc-devel maillist  -  fpc-devel@lists.freepascal.org
> >> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> >>
> > 
> > 
> >       
> > ___
> > fpc-devel maillist  -  fpc-devel@lists.freepascal.org
> > http://lists.freepascal.org/mailman/listinfo/fpc-devel
> > 
> 
> ___
> fpc-devel maillist  -  fpc-devel@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-09-14 Thread Florian Klämpfl
Am 14.09.2010 21:31, schrieb Leonardo M. Ramé:
> My code, don't worry.

Well, I worry because no code to compile should be able to trigger an
internal error.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-09-14 Thread Leonardo M . Ramé
I understand. Sadly I can't reproduce the error anymore, my code was fixed   
yesterday, if I can get the broken code again I'll send it to you.

Leonardo M. Ramé
http://leonardorame.blogspot.com


--- On Tue, 9/14/10, Florian Klämpfl  wrote:

> From: Florian Klämpfl 
> Subject: Re: [fpc-devel] Fatal: Internal error 200111022
> To: "FPC developers' list" 
> Date: Tuesday, September 14, 2010, 4:32 PM
> Am 14.09.2010 21:31, schrieb Leonardo
> M. Ramé:
> > My code, don't worry.
> 
> Well, I worry because no code to compile should be able to
> trigger an
> internal error.
> ___
> fpc-devel maillist  -  fpc-devel@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Michael Van Canneyt


Hello,

Which 'Count' should the compiler select ? I suspect TSub.Count ?

I think we should prohibit this dubious construct in ObjFC mode.
(but try to be delphi compatible in Delphi mode)

Michael.

On Wed, 20 Oct 2010, Birger Jansen wrote:


I'm not sure if this is the correct way to report this, please correct me if I 
should report in another way.

I found an old conversation between Leonardo and Florian about the Fatail 
internal error 200111022. The thread concluded that they could not reproduce 
the error.

I got this error while converting a large project from Delphi to FPC. It turns 
out that a base class has a property Count, and a derived class has a function 
with the same name Count. This will compile, untill you call the property or 
function Count.

I created an example that should explain it. Uncomment the marked line to get 
the fatal internal error:

program project1;

{$mode objfpc}{$H+}

uses
 {$IFDEF UNIX}{$IFDEF UseCThreads}
 cthreads,
 {$ENDIF}{$ENDIF}
 Classes;

type

 TBase = class
 private
   function GetCount: Integer;
 public
   property Count: Integer read GetCount;
 end;

 TSub = class(TBase)
 public
   function Count: Integer; overload;
 end;

function TSub.Count: Integer;
begin
 Result := 0;
end;

{ TBase }

function TBase.GetCount: Integer;
begin
 Result := 0;
end;

var
 MySub: TSub;
 i : Integer;
begin
 MySub := TSub.Create;
// uncomment the next line for Fatal Internal error 200111022:
//  for i := 0 to MySub.Count do begin end;
end.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Michael Van Canneyt



On Wed, 20 Oct 2010, Birger Jansen wrote:


Can you please enter a bug-report for this, and simply mention these facts ?


Done: http://bugs.freepascal.org/view.php?id=17675


Thank you.

Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Jonas Maebe

On 20 Oct 2010, at 13:37, Michael Van Canneyt wrote:

> Can you please enter a bug-report for this, and simply mention these facts ?
> - Fix as suggested in Delphi mode
> - Prohibit in ObjFPC mode ?

Prohibiting it breaks the compilation of dom_html.pp:

dom_html.pp(66,14) Error: Duplicate identifier "ClassName"


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Jonas Maebe

On 20 Oct 2010, at 14:56, Jonas Maebe wrote:

> 
> On 20 Oct 2010, at 13:37, Michael Van Canneyt wrote:
> 
>> Can you please enter a bug-report for this, and simply mention these facts ?
>> - Fix as suggested in Delphi mode
>> - Prohibit in ObjFPC mode ?
> 
> Prohibiting it breaks the compilation of dom_html.pp:
> 
> dom_html.pp(66,14) Error: Duplicate identifier "ClassName"

And some more:

fpgtkext.pp(78,14) Error: Duplicate identifier "UpdatePolicy"
fpgtkext.pp(78,14) Hint: Identifier already defined in unit FPGTK at line 1276

ltelnet.pp(143,14) Error: Duplicate identifier "SocketClass"
ltelnet.pp(143,14) Hint: Identifier already defined in unit LNET at line 214
lftp.pp(97,14) Error: Duplicate identifier "SocketClass"
lftp.pp(97,14) Hint: Identifier already defined in unit LNET at line 214


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Sergei Gorelkin

Jonas Maebe пишет:

On 20 Oct 2010, at 13:37, Michael Van Canneyt wrote:


Can you please enter a bug-report for this, and simply mention these facts ?
- Fix as suggested in Delphi mode
- Prohibit in ObjFPC mode ?


Prohibiting it breaks the compilation of dom_html.pp:

dom_html.pp(66,14) Error: Duplicate identifier "ClassName"


If dom_html is the only problem, I think it can be fixed (by renaming 
ClassName). The w3.org specs
has many property names which clash with Pascal reserved words (type, label, 
etc. That 'ClassName'
was intended to be 'Class'.), so it's anyway impossible to follow the specs 
closely.

Regards,
Sergei

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Jonas Maebe

On 20 Oct 2010, at 15:12, Sergei Gorelkin wrote:

> Jonas Maebe пишет:
>> Prohibiting it breaks the compilation of dom_html.pp:
>> dom_html.pp(66,14) Error: Duplicate identifier "ClassName"
> If dom_html is the only problem, I think it can be fixed (by renaming 
> ClassName). The w3.org specs
> has many property names which clash with Pascal reserved words (type, label, 
> etc. That 'ClassName'
> was intended to be 'Class'.), so it's anyway impossible to follow the specs 
> closely.

Other than the ones from my second mail, Lazarus also has problems:

comctrls.pp(930,14) Error: Duplicate identifier "Owner"
comctrls.pp(930,14) Hint: Identifier already defined in unit CLASSES at line 497

(and probably more, since the compilation doesn't get further).

I guess it's more realistic to allow it in all modes.


Jonas___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Sven Barth

On 20.10.2010 15:33, Jonas Maebe wrote:


On 20 Oct 2010, at 15:12, Sergei Gorelkin wrote:


Jonas Maebe пишет:

Prohibiting it breaks the compilation of dom_html.pp:
dom_html.pp(66,14) Error: Duplicate identifier "ClassName"

If dom_html is the only problem, I think it can be fixed (by renaming 
ClassName). The w3.org specs
has many property names which clash with Pascal reserved words (type, label, 
etc. That 'ClassName'
was intended to be 'Class'.), so it's anyway impossible to follow the specs 
closely.


Other than the ones from my second mail, Lazarus also has problems:

comctrls.pp(930,14) Error: Duplicate identifier "Owner"
comctrls.pp(930,14) Hint: Identifier already defined in unit CLASSES at line 497

(and probably more, since the compilation doesn't get further).

I guess it's more realistic to allow it in all modes.


I don't know how others or the devs see that, but in my opinion its a 
very confusing possibilty to be able to redeclare e.g. "ClassName" (I 
shivered heavily when I read that). Like it's also confusing to have 
local variables in methods named like members of that class (which is 
forbidden in objfpc as well as you all might know).


All these cases should be fixed (although that might break further 
code), but its for some greater good (less confusion for new users of 
such a class). Until the release after 2.4.2 all code will be fixed 
hopefully (what about adding a warning to 2.4.2 for such cases?).


Regards,
Sven
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Michael Van Canneyt



On Wed, 20 Oct 2010, Sven Barth wrote:


On 20.10.2010 15:33, Jonas Maebe wrote:


On 20 Oct 2010, at 15:12, Sergei Gorelkin wrote:


Jonas Maebe пишет:

Prohibiting it breaks the compilation of dom_html.pp:
dom_html.pp(66,14) Error: Duplicate identifier "ClassName"
If dom_html is the only problem, I think it can be fixed (by renaming 
ClassName). The w3.org specs
has many property names which clash with Pascal reserved words (type, 
label, etc. That 'ClassName'
was intended to be 'Class'.), so it's anyway impossible to follow the 
specs closely.


Other than the ones from my second mail, Lazarus also has problems:

comctrls.pp(930,14) Error: Duplicate identifier "Owner"
comctrls.pp(930,14) Hint: Identifier already defined in unit CLASSES at 
line 497


(and probably more, since the compilation doesn't get further).

I guess it's more realistic to allow it in all modes.


I don't know how others or the devs see that, but in my opinion its a very 
confusing possibilty to be able to redeclare e.g. "ClassName" (I shivered 
heavily when I read that). Like it's also confusing to have local variables 
in methods named like members of that class (which is forbidden in objfpc as 
well as you all might know).


All these cases should be fixed (although that might break further code), but 
its for some greater good (less confusion for new users of such a class). 
Until the release after 2.4.2 all code will be fixed hopefully (what about 
adding a warning to 2.4.2 for such cases?).


If prohibiting (my preferred option) would cause too much breakage, I would 
also think that a warning is the least we can do.


I'm sure that the ComCtrls case above is a very dubious case indeed, I see very
little reason to override TComponents 'Owner'.

Michael.___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


RE: Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Birger Jansen
Hi Michael,

Yes, TSub.Count should be used. I agree that it is dirty and confusing. Best 
would be to only have it work in Delphi mode.

Kind regards,
  Birger


-Oorspronkelijk bericht-
Van: Michael Van Canneyt 
Verzonden: wo 20-10-2010 13:22
Aan: FPC developers' list ; 
Onderwerp: Re: [fpc-devel] Fatal: Internal error 200111022

> 
> Hello,
> 
> Which 'Count' should the compiler select ? I suspect TSub.Count ?
> 
> I think we should prohibit this dubious construct in ObjFC mode.
> (but try to be delphi compatible in Delphi mode)
> 
> Michael.
> 
> On Wed, 20 Oct 2010, Birger Jansen wrote:
> 
> > I'm not sure if this is the correct way to report this, please correct me 
> > if 
> I should report in another way.
> >
> > I found an old conversation between Leonardo and Florian about the Fatail 
> internal error 200111022. The thread concluded that they could not reproduce 
> the error.
> >
> > I got this error while converting a large project from Delphi to FPC. It 
> turns out that a base class has a property Count, and a derived class has a 
> function with the same name Count. This will compile, untill you call the 
> property or function Count.
> >
> > I created an example that should explain it. Uncomment the marked line to 
> > get 
> the fatal internal error:
> >
> > program project1;
> >
> > {$mode objfpc}{$H+}
> >
> > uses
> >  {$IFDEF UNIX}{$IFDEF UseCThreads}
> >  cthreads,
> >  {$ENDIF}{$ENDIF}
> >  Classes;
> >
> > type
> >
> >  TBase = class
> >  private
> >function GetCount: Integer;
> >  public
> >property Count: Integer read GetCount;
> >  end;
> >
> >  TSub = class(TBase)
> >  public
> >function Count: Integer; overload;
> >  end;
> >
> > function TSub.Count: Integer;
> > begin
> >  Result := 0;
> > end;
> >
> > { TBase }
> >
> > function TBase.GetCount: Integer;
> > begin
> >  Result := 0;
> > end;
> >
> > var
> >  MySub: TSub;
> >  i : Integer;
> > begin
> >  MySub := TSub.Create;
> > // uncomment the next line for Fatal Internal error 200111022:
> > //  for i := 0 to MySub.Count do begin end;
> > end.
> > ___
> > fpc-devel maillist  -  fpc-devel@lists.freepascal.org
> > http://lists.freepascal.org/mailman/listinfo/fpc-devel
> >
> ___
> fpc-devel maillist  -  fpc-devel@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


RE: Re: [fpc-devel] Fatal: Internal error 200111022

2010-10-20 Thread Michael Van Canneyt



On Wed, 20 Oct 2010, Birger Jansen wrote:


Hi Michael,

Yes, TSub.Count should be used. I agree that it is dirty and confusing. Best 
would be to only have it work in Delphi mode.



Hi,

Can you please enter a bug-report for this, and simply mention these facts ?
- Fix as suggested in Delphi mode
- Prohibit in ObjFPC mode ?

So it won't be forgotten.

Michael.


Kind regards,
 Birger


-Oorspronkelijk bericht-
Van: Michael Van Canneyt 
Verzonden: wo 20-10-2010 13:22
Aan: FPC developers' list ;
Onderwerp: Re: [fpc-devel] Fatal: Internal error 200111022



Hello,

Which 'Count' should the compiler select ? I suspect TSub.Count ?

I think we should prohibit this dubious construct in ObjFC mode.
(but try to be delphi compatible in Delphi mode)

Michael.

On Wed, 20 Oct 2010, Birger Jansen wrote:


I'm not sure if this is the correct way to report this, please correct me if

I should report in another way.


I found an old conversation between Leonardo and Florian about the Fatail

internal error 200111022. The thread concluded that they could not reproduce
the error.


I got this error while converting a large project from Delphi to FPC. It

turns out that a base class has a property Count, and a derived class has a
function with the same name Count. This will compile, untill you call the
property or function Count.


I created an example that should explain it. Uncomment the marked line to get

the fatal internal error:


program project1;

{$mode objfpc}{$H+}

uses
 {$IFDEF UNIX}{$IFDEF UseCThreads}
 cthreads,
 {$ENDIF}{$ENDIF}
 Classes;

type

 TBase = class
 private
   function GetCount: Integer;
 public
   property Count: Integer read GetCount;
 end;

 TSub = class(TBase)
 public
   function Count: Integer; overload;
 end;

function TSub.Count: Integer;
begin
 Result := 0;
end;

{ TBase }

function TBase.GetCount: Integer;
begin
 Result := 0;
end;

var
 MySub: TSub;
 i : Integer;
begin
 MySub := TSub.Create;
// uncomment the next line for Fatal Internal error 200111022:
//  for i := 0 to MySub.Count do begin end;
end.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel