Thread overview
typedef const bug
Aug 03, 2002
Pavel Minayev
Aug 03, 2002
Walter
Aug 03, 2002
Pavel Minayev
Aug 03, 2002
Walter
Aug 03, 2002
Pavel Minayev
Aug 04, 2002
Walter
August 03, 2002
Walter, try this:

	class Window
	{
		import windows;
		HWND hWnd = null;
	}

Error: "non-constant expression cast(HANDLE)(null)".

When I cast it explicitly, the error is the same. HWND
is an alias for HANDLE, and HANDLE is typedef'ed
as void*. If you make HANDLE alias rather than typedef,
it works.
August 03, 2002
typedef needs work :-(

"Pavel Minayev" <evilone@omen.ru> wrote in message
news:CFN374715384359838@news.digitalmars.com...
 If you make HANDLE alias rather than typedef,
it works.


August 03, 2002
On Sat, 3 Aug 2002 10:53:53 -0700 "Walter" <walter@digitalmars.com> wrote:

> typedef needs work :-(

Then maybe it would be wise to make HANDLE alias for now? So that programs at least work... =)
August 03, 2002
"Pavel Minayev" <evilone@omen.ru> wrote in message news:CFN374719723159607@news.digitalmars.com...
> Then maybe it would be wise to make HANDLE alias for now? So that programs at least work... =)

Yes. Consider typedef broken for the time being.


August 03, 2002
On Sat, 3 Aug 2002 14:53:17 -0700 "Walter" <walter@digitalmars.com> wrote:

> Yes. Consider typedef broken for the time being.

By the way, the bug seems even more strange. You CANNOT cast null to a HWND:

	const HWND hWnd = cast(HWND)(null);	// doesn't work (with or without cast)

But you CAN cast zero to a HWND:

	const HWND hWnd = cast(HWND)(0);	// works!!!

Maybe something's wrong with null?
August 04, 2002
I'll check it out.

"Pavel Minayev" <evilone@omen.ru> wrote in message
news:CFN37472106677037@news.digitalmars.com...
By the way, the bug seems even more strange. You CANNOT cast
null to a HWND:

const HWND hWnd = cast(HWND)(null); // doesn't work (with or without cast)

But you CAN cast zero to a HWND:

const HWND hWnd = cast(HWND)(0); // works!!!

Maybe something's wrong with null?