[Issue 8150] Throwing nothrow struct constructor?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 25 06:50:51 PDT 2012


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



--- Comment #6 from Kenji Hara <k.hara.pg at gmail.com> 2012-09-25 06:51:38 PDT ---
(In reply to comment #4)
> Now compiling this code:
> 
> struct Foo {
>     this(int) nothrow { // line 2
>         throw new Exception("something");
>     }
> }
> void main() {
>     Foo(1);
> }
> 
> 
> It gives:
> 
> temp.d(3): Error: object.Exception is thrown but not caught
> temp.d(2): Warning: statement is not reachable
> temp.d(2): Error: constructor temp.Foo.this 'this' is nothrow yet may throw
> 
> What's the statement not not reachable at line 2?

This is diagnostic bug. I've opened new bug 8724.

-- 
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