digitalmars.D.learn - Lazy param with nothrow
- Andrea Fontana (3/3) Mar 01 2016 This very very simple function [1] won't compile.
- Nemo (4/8) Mar 01 2016 writeln isn't nothrow so you can't call it from test which is
- Andrea Fontana (8/17) Mar 01 2016 You are right about writeln & nothrow but the problem is still
- ag0aep6g (4/7) Mar 01 2016 It's a bug. Lazy parameters generate delegates. nothrow is currently not...
This very very simple function [1] won't compile. It says that param t is not nothrow. Why? What's wrong with this? http://dpaste.dzfl.pl/bfc382e62711
Mar 01 2016
On Tuesday, 1 March 2016 at 13:35:08 UTC, Andrea Fontana wrote:This very very simple function [1] won't compile. It says that param t is not nothrow. Why? What's wrong with this? http://dpaste.dzfl.pl/bfc382e62711writeln isn't nothrow so you can't call it from test which is nothrow without a try .. catch. The error message is misleading.
Mar 01 2016
On Tuesday, 1 March 2016 at 13:41:38 UTC, Nemo wrote:On Tuesday, 1 March 2016 at 13:35:08 UTC, Andrea Fontana wrote:You are right about writeln & nothrow but the problem is still there if instead of: writeln(t); you write: t; (that's a reduced example, in real code I don't use writeln or other non-nothrow functions)This very very simple function [1] won't compile. It says that param t is not nothrow. Why? What's wrong with this? http://dpaste.dzfl.pl/bfc382e62711writeln isn't nothrow so you can't call it from test which is nothrow without a try .. catch. The error message is misleading.
Mar 01 2016
On 01.03.2016 14:35, Andrea Fontana wrote:This very very simple function [1] won't compile. It says that param t is not nothrow. Why? What's wrong with this? http://dpaste.dzfl.pl/bfc382e62711It's a bug. Lazy parameters generate delegates. nothrow is currently not inferred for those delegates. It should be. https://issues.dlang.org/show_bug.cgi?id=12647
Mar 01 2016