[Issue 368] New: "immediate"-function types allowed as the return type of functions.

Thomas Kuehne thomas-dloop at kuehne.cn
Fri Oct 6 00:05:25 PDT 2006


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

d-bugmail at puremagic.com schrieb am 2006-09-26:
> http://d.puremagic.com/issues/show_bug.cgi?id=368

> "immediate"-function types allowed as the return type of functions. Example:
>
> --------
> void func(int a) { }
> //typedef int ft(int);
>
> typeof(func) test() {
> }
> ----
> Instead, the compiler complains that a return is needed (yet such return value
> can not be specified). Using a typedef results in the same problem.
>
> The following extended testcase crashes the compiler:
>
> --------
> void func(int a) { }
>
> typeof(func) test() {
>     if(true) throw new Exception("");
> }
> ----

Added to DStress as
http://dstress.kuehne.cn/nocompile/t/typeof_12_A.d
http://dstress.kuehne.cn/nocompile/t/typeof_12_B.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFFJf/XLK5blCcjpWoRAqSbAJ9gzkKXk4I/n1rJ5ff7IVljm+2uyQCbB/d+
cdjrT9FpgLLGafR4lAKLEVM=
=H3+j
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list