Board index » delphi » Weird 'Incompatible types' error

Weird 'Incompatible types' error

Hi all,

I sometimes get a compiler error message:
        Incompatible types: 'xxx' and 'TDataConfig'

The message is generated for an assignment of a TDataConfig to a
TDataConfig, which is my own defined type (defined in the same unit).
I'm sure the assignment is correct.

Now, I made the following puzzling observations:
1) 'xxx' is a nonsense strings, e.g. '@#||L.('.
2) not every compile of the unit generates this message. Often
   the compiler does not complain at all.
3) when the error is reported and I select Project/Compile, the error
   is reported again, but with a different 'xxx'.
4) when I rebuild the whole project (Project/Build), the compiler
   never complains and the program runs fine.

Anyone seen this before and has any hint of where to look? Any help
is appreciated very much! My Delphi version is 2.00.

Thanks in advance,

Wim.

 

Re:Weird 'Incompatible types' error


On 6 Mar 1997 13:00:56 GMT, "Wim van Hoorn" <cade...@worldonline.nl> may have
written:

Quote
>Hi all,

>I sometimes get a compiler error message:
>    Incompatible types: 'xxx' and 'TDataConfig'

>The message is generated for an assignment of a TDataConfig to a
>TDataConfig, which is my own defined type (defined in the same unit).
>I'm sure the assignment is correct.

>Now, I made the following puzzling observations:
>1) 'xxx' is a nonsense strings, e.g. '@#||L.('.
>2) not every compile of the unit generates this message. Often
>   the compiler does not complain at all.
>3) when the error is reported and I select Project/Compile, the error
>   is reported again, but with a different 'xxx'.
>4) when I rebuild the whole project (Project/Build), the compiler
>   never complains and the program runs fine.

>Anyone seen this before and has any hint of where to look? Any help
>is appreciated very much! My Delphi version is 2.00.

>Thanks in advance,

>Wim.

Are you sure you're not programming in C? Seriously, that sounds like a
pointer is not initialized (a common problem in C.)

It could be a pchar that is not being allocated. Most likely it depends upon
how the code gets to where it happens. Sorry, but I cannot help locate it
without looking at all your code and that, at the moment, is beyond my time
allotment.

dick MacDonald
{*word*106}mac@(delete this to reply)fastservice.com
The extra info is included to foil the automated collection 'bots.

Re:Weird 'Incompatible types' error


"Wim van Hoorn" <cade...@worldonline.nl> wrote:

Quote
>Hi all,

>I sometimes get a compiler error message:
>    Incompatible types: 'xxx' and 'TDataConfig'

>The message is generated for an assignment of a TDataConfig to a
>TDataConfig, which is my own defined type (defined in the same unit).
>I'm sure the assignment is correct.

>Now, I made the following puzzling observations:
>1) 'xxx' is a nonsense strings, e.g. '@#||L.('.
>2) not every compile of the unit generates this message. Often
>   the compiler does not complain at all.
>3) when the error is reported and I select Project/Compile, the error
>   is reported again, but with a different 'xxx'.
>4) when I rebuild the whole project (Project/Build), the compiler
>   never complains and the program runs fine.

>Anyone seen this before and has any hint of where to look? Any help
>is appreciated very much! My Delphi version is 2.00.

Get Delphi 2.01
--
Stefan.Hoffmeis...@Uni-Passau.de
http://kakadu.rz.uni-passau.de/~w4hoff01/
University of Passau, Bavaria, Germany

Other Threads