Re: [Issue 8150] Throwing nothrow struct constructor?

2012-09-25 Thread monarch_dodra
On Monday, 24 September 2012 at 16:49:55 UTC, 
bearophile_h...@eml.cc wrote:

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


bearophile_h...@eml.cc changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #4 from bearophile_h...@eml.cc 2012-09-24 09:50:47 
PDT ---

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?


Could you also check that a nothrow constructor can still throw 
an Error please?


From related: http://d.puremagic.com/issues/show_bug.cgi?id=8675


[Issue 8150] Throwing nothrow struct constructor?

2012-09-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8150



--- Comment #6 from Kenji Hara k.hara...@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: ---


[Issue 8150] Throwing nothrow struct constructor?

2012-09-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8150



--- Comment #7 from Kenji Hara k.hara...@gmail.com 2012-09-25 06:56:50 PDT ---
(In reply to comment #5)
 Could you also check that a nothrow constructor can still throw 
 an Error please?
 
 From related: http://d.puremagic.com/issues/show_bug.cgi?id=8675

Nothrow check mechanism for the constructors is same as for normal functions,
and that's already fixed by 8675. So, there is no problem.

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


[Issue 8150] Throwing nothrow struct constructor?

2012-09-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8150



--- Comment #8 from monarchdo...@gmail.com 2012-09-25 07:04:01 PDT ---
(In reply to comment #7)
 (In reply to comment #5)
  Could you also check that a nothrow constructor can still throw 
  an Error please?
  
  From related: http://d.puremagic.com/issues/show_bug.cgi?id=8675
 
 Nothrow check mechanism for the constructors is same as for normal functions,
 and that's already fixed by 8675. So, there is no problem.

Ok, thanks. Just double checking: wouldn't want to re-introduce a bug :)

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


[Issue 8150] Throwing nothrow struct constructor?

2012-09-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8150



--- Comment #3 from github-bugzi...@puremagic.com 2012-09-24 07:47:09 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/c519a4d9dcc8b65aaadba2f30fdecf63bec5df99
fix Issue 8150 - Throwing nothrow struct constructor?

https://github.com/D-Programming-Language/dmd/commit/36e0a9b975941aac4bf5bd6fd044e6acbf2504e9
Merge pull request #1138 from 9rnsr/fix8150

Issue 8150 - Throwing nothrow struct constructor?

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


[Issue 8150] Throwing nothrow struct constructor?

2012-09-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8150


bearophile_h...@eml.cc changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #4 from bearophile_h...@eml.cc 2012-09-24 09:50:47 PDT ---
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?

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


[Issue 8150] Throwing nothrow struct constructor?

2012-09-23 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8150



--- Comment #2 from github-bugzi...@puremagic.com 2012-09-22 23:43:35 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/cd1252036b41533ba5b132c99471e84d468d1f0b
Making Throwable and derived classes constructors @safe/pure/nothrow.

This is supplemental change for fixing issue 8150.
Constructing throwable object can be @sage, pure, and nothrow.

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


[Issue 8150] Throwing nothrow struct constructor?

2012-09-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8150


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||pull


--- Comment #1 from Kenji Hara k.hara...@gmail.com 2012-09-22 22:22:46 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1138
https://github.com/D-Programming-Language/druntime/pull/309

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