You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std.path.expandTilde: make compatible with scope and preview='in'
When using `expandTilde` with 'priview=in' enabled,
it requires to duplicate value to be able to call this function.
Within this commit the signature of expandTilde function is
changed from `string expandTilde(string inputPath) @safe nothrow`
to `string expandTilde(return scope const string inputPath) @safe nothrow`
thus, after this commit it is possible to use this func in scope
context.
Example case:
```d
/+ dub.sdl:
name "dub-example"
dflags "-preview=in" "-preview=dip1000"
+/
import std.stdio;
import std.path;
@safe:
string fun(in string path) {
return path.expandTilde;
}
void main() {
string p = fun("~/tests/1");
writefln("P: %s", p);
}
```
0 commit comments