On Sunday, 13 November 2022 at 19:06:40 UTC, 0xEAB wrote:
Why does only the latter sample compile?
The former leads to the following warning:
Are you using the `-preview=dip1000` compiler flag?
I didn't manage to reproduce this in a simple example of my own.
The closest I equivalent I
On Sunday, 13 November 2022 at 19:36:48 UTC, Dennis wrote:
Can you please provide a full example? I'm missing the
definitions of _headers, hstring, values
```d
/++
“HTTP message string” – short-hand for `const(char)[]``.
$(SIDEBAR
Not sure about the name.
Would have
On Sunday, 13 November 2022 at 19:06:40 UTC, 0xEAB wrote:
Why does only the latter sample compile?
The former leads to the following warning:
Can you please provide a full example? I'm missing the
definitions of _headers, hstring, values, and I suspect there's
at least one `@safe` annotation
On Sunday, 13 November 2022 at 19:06:40 UTC, 0xEAB wrote:
```d
struct Foo { /* … */
hstring[] getHeader(LowerCaseToken name) scope return
{
return _headers[name].values;
}
[...]
There's an old saying "you can't make sense out of scope"
```d
struct Foo { /* … */
hstring[] getHeader(LowerCaseToken name) scope return
{
return _headers[name].values;
}
hstring[] getHeader(hstring name)() scope return
{
enum token = LowerCaseToken.makeConverted(name);
return this.getHeader(token); // line