Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread The referenced class ... is not compatible with the expression being cast
Thu, Aug 6 2015 11:59 AMPermanent Link

Emin

Does anyone has an idea why I am getting this compiler error:

The referenced class TDvlButtonComboBox is not compatible with the expression being cast

  for K := 0 to FForms.Count -1 do
  begin
     LForm := TForm(FForms[K]);
     for J := 0 to LForm.ComponentCount -1 do
        if LForm.Component[J] is TDvlButtonComboBox then
        begin
           LComboBox := TDvlButtonComboBox(LForm.Component[J]); <--- COMPILER ERROR HERE
           LComboBox.LoadListDataSetColumns;
        end;
  end;
Thu, Aug 6 2015 1:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Emin,

<< Does anyone has an idea why I am getting this compiler error: >>

It could be a compiler bug, but I'm not sure where since we do that all over the component library and runtime code.  Do you have a small example that you can email me ?

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Aug 7 2015 3:10 AMPermanent Link

Emin

Tim

>>> It could be a compiler bug, but I'm not sure where since we do that all over the component library and runtime code.  Do you have a small example that you can email me ?


I know it is not logical but same peace of code compiled successfully today.
And I don't have any snapshot or diff to yesterday.

So please disregard this false alarm.

Thanks
Emin
Fri, Aug 7 2015 10:17 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Emin,

<< I know it is not logical but same peace of code compiled successfully today. And I don't have any snapshot or diff to yesterday.

So please disregard this false alarm. >>

There are still a couple of buglets in the compiler (or just one, I'm not sure yet) that I'm hoping to squash soon.  They have to do with unit references and modifications to referenced units.  Unfortunately, they're "Heisenbugs":

https://en.wikipedia.org/wiki/Heisenbug

and don't happen all of the time, so I'm having a hard time replicating them enough to figure out the source problem and fix them.  Also, fortunately, re-compiling always fixes the problem.

Some of the symptoms include an "Invalid value conversion" error at design-time.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, May 11 2016 11:53 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> << Does anyone has an idea why I am getting this compiler error: >>
>
> It could be a compiler bug, but I'm not sure where since we do that
> all over the component library and runtime code.  Do you have a small
> example that you can email me ?

FWIW, I have this too, and it appears to be a circular reference sort
of issue, but I'm not sure. Unfortunately the sample is not small, but
if you want the source I can get it to you. It is currently "solid" and
not transient. I have to work out how to fix it as it is crucial to my
code!

--

Matthew Jones
Wed, May 11 2016 12:02 PMPermanent Link

Matthew Jones

Matthew Jones wrote:

> FWIW, I have this too, and it appears to be a circular reference sort
> of issue, but I'm not sure. Unfortunately the sample is not small, but
> if you want the source I can get it to you. It is currently "solid"
> and not transient. I have to work out how to fix it as it is crucial
> to my code!

What is the difference between these:

  TWriterState = class(TObject)
  TWriter = class

and specifically, what about:
  TPersistent = class

If I have:
var
  xObject : TObject;
begin
  TMyClassDerivedFromTPersistent(xObject);
 
should it work?

--

Matthew Jones
Wed, May 11 2016 3:59 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< What is the difference between these: >>

In terms of ancestry, nothing.

<< If I have:
var
  xObject : TObject;
begin
  TMyClassDerivedFromTPersistent(xObject);
 
should it work? >>

Yes.

Tim Young
Elevate Software
www.elevatesoft.com
Image