https://issues.dlang.org/show_bug.cgi?id=22619
Robert Schadek <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Robert Schadek <[email protected]> --- In 2.098.1 I get the following as well. ```dlang Nullable!(T) mapHelper(T)(T[] data, long id) { auto f = data.find!(it => it.personId == id); if(f.empty) { return Nullable!(T).init; } else { return nullable(f.front); // failing line } } ``` file.d(6): Error: variable `rest.excel.mapHelper!(SomeStruct).mapHelper.__copytmp12381` `inout` variables can only be declared inside `inout` functions SomeStruct is just that, some struct. It compiles and works if I rewrite mapHelper ti ```dlang Nullable!(T) mapHelper(T)(T[] data, long id) { auto f = data.find!(it => it.personId == id); if(f.empty) { return Nullable!(T).init; } else { T ret = f.front; Nullable!(T) tmp; tmp = ret; return tmp; } } ``` This required a 160 line patch today for work. --
