Strange cast error in compile-time function

Stéphan Kochen stephan at kochen.nl
Tue Jul 24 09:09:18 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello all,

I'm stuck on something. I'm writing some compile-time stuff to generate
a function that gets me the Unicode general category for a dchar. I have
some compile-time functions that read from the TXTs from the Unicode
Character Database and create the actual D code for me.

The source code is attached.

The functions work at run-time and output the correct D code, when I
print the string return value using writefln. But when I try to use a
mixin to 'paste' it in a function at compile-time, I get a vague error:
	"Error: cannot cast int to RowData"
(and nothing else.)

RowData is a struct I use. It might be interesting to note that this
happens with DMD 1.0 (and the GDC based on it), but with DMD 1.020 I get
a slightly different (but equally vague) error:
	"Error: cannot cast int to char[][]"

I've been staring at this for hours. Halp! :)

Thanks in advance,
- -- Stéphan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGpiQucFUq0gzqDwQRAjz0AJ0ZexMPgBxHxQXBGshI6hghgXDD8ACgspRd
GWIHuG9P7iV9k/CNf+bGKsU=
=jyR8
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unitools.d
Type: text/x-dsrc
Size: 8679 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070724/1c450d35/attachment.d>


More information about the Digitalmars-d mailing list