Thread overview
DIP-1000 scope analysis doesn't kick in for small-size-optimized GC-string
Apr 19, 2018
Per Nordlöw
Apr 19, 2018
Per Nordlöw
Apr 20, 2018
Radu
April 19, 2018
I'm now satisfied with my SSOString at

https://github.com/nordlow/phobos-next/blob/master/src/sso_string.d

However, I'm having problems within making lifetime analysis via scope kick in. For instance, the function `f` at

https://github.com/nordlow/phobos-next/blob/master/src/sso_string.d#L219

shouldn't compile, but it does.

Have I missed something or is this yet another corner-case that requires a new bugzilla issue?

Walter?

Andrei?
April 19, 2018
On Thursday, 19 April 2018 at 17:36:19 UTC, Per Nordlöw wrote:
> However, I'm having problems within making lifetime analysis via scope kick in. For instance, the function `f` at
>
> https://github.com/nordlow/phobos-next/blob/master/src/sso_string.d#L219

Note that qualifying `opSlice` as `inout` doesn't help.
April 20, 2018
On Thursday, 19 April 2018 at 17:36:19 UTC, Per Nordlöw wrote:
> I'm now satisfied with my SSOString at
>
> https://github.com/nordlow/phobos-next/blob/master/src/sso_string.d
>
> However, I'm having problems within making lifetime analysis via scope kick in. For instance, the function `f` at
>
> https://github.com/nordlow/phobos-next/blob/master/src/sso_string.d#L219
>
> shouldn't compile, but it does.
>
> Have I missed something or is this yet another corner-case that requires a new bugzilla issue?
>
> Walter?
>
> Andrei?

Removing `scope` from the function prototype will work. See https://run.dlang.io/is/BIYSY4

I think it is a bug, but might be wrong as dip1000 spec is not up2date.