[Issue 9055] Compiler segfaults on forward reference to auto-return member function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 4 10:22:09 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9055



--- Comment #7 from timon.gehr at gmx.ch 2013-01-04 10:22:07 PST ---
(In reply to comment #5)
> This is not a CTFE bug. Here is an example which doesn't use CTFE, properties,
> or invalid use of 'this':
> ---
> class C
> {
>     enum a = typeof(this.b()).init;
>     static auto b(){ return 0; }
> }
> 
> ---
> If in any of these examples you replace this.b() by simply b(), you get a
> "forward reference to b" error message.
> 

But forward references are allowed. This is another bug.

> Here's a basic patch to do the same thing in this case. I'm not really happy
> with it though, the errors for b() and this.b() should be generated in the same
> function.
> ...

Both cases are valid D code. No error should be generated in either case.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list