Thread overview
dmd 0.50 release
Nov 20, 2002
Walter
Nov 20, 2002
Burton Radons
Nov 21, 2002
Andrew Edwards
Nov 21, 2002
Andrew Edwards
Nov 21, 2002
Walter
Nov 22, 2002
Roberto Mariottini
Nov 26, 2002
Patrick Down
November 20, 2002
www.digitalmars.com/d/changelog.html



November 20, 2002
The code:

    void main ()
    {
        bit x;

        x = "bar" == "bar";
    }

Triggers the new implicit bit cast error.  It's type-dependent - comparing int won't trigger it.

November 21, 2002
Thats because an explicit cast is required to convert from string "bar" to bit.

Try:

void main ()
{
    bit x;
    x = (bit)"bar" == (bit)"bar";
}

By the way: can you take a look at cartoon.d? It's got the same problems in D v0.50.

Here's the error:
cartoon.d(692): function checked (bit value) does not match argument types
(int)

I'm not sure how to typecast a function's return type;

"Burton Radons" <loth@users.sourceforge.net> wrote in message news:arfr2l$7h4$1@digitaldaemon.com...
> The code:
>
>      void main ()
>      {
>          bit x;
>
>          x = (bit)"bar" == "bar";
>      }
>
> Triggers the new implicit bit cast error.  It's type-dependent - comparing int won't trigger it.
>


November 21, 2002
Please disregard my earlier comment. I'll begin reading threads completely before responding to them.

Andrew


November 21, 2002
"Andrew Edwards" <crxace13@nospam.comcast.net> wrote in message news:arjg8p$1cv9$1@digitaldaemon.com...
> By the way: can you take a look at cartoon.d? It's got the same problems
in
> D v0.50.
>
> Here's the error:
> cartoon.d(692): function checked (bit value) does not match argument types
> (int)
>
> I'm not sure how to typecast a function's return type;

It sounds like you're trying to pass an int to a function that takes a bit. Try cast(bit) before the int expression.


November 22, 2002
"Burton Radons" <loth@users.sourceforge.net> ha scritto nel messaggio news:arfr2l$7h4$1@digitaldaemon.com...
> The code:
>
>      void main ()
>      {
>          bit x;
>
>          x = "bar" == "bar";
>      }
>
> Triggers the new implicit bit cast error.  It's type-dependent - comparing int won't trigger it.

Do you mean:

 x = ("bar" == "bar");

or

(x = "bar") == "bar";

What is the right operator precendence?

Ciao


November 26, 2002
The following generates the error
Internal error: ..\ztc\cgobj.c 3084

If I put the template in the same file where
it is used the error does not occur.

//File: eventtemplates.d----------------
template EvtType(T1,T2)
{
  struct Trigger
  {
    alias void delegate(Object sender,T1,T2) eventFunc;

    void Add(eventFunc f)
    {
    }
  }
}

//File: winbase.d----------------
import eventtemplates;

instance EvtType(int,int) MouseEvent;

class Window
{
  public
  {
    MouseEvent.Trigger mouseDown;
  }
}