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 605
}
}
struct Foo { /* … */
hstring[] getHeader(LowerCaseToken name) scope return
{
return _headers[name].values;
}
hstring[] getHeader(hstring name)() scope return
{
enum token = LowerCaseToken.makeConverted(name);
return _headers[token].values; // line 605
}
}
Why does only the latter sample compile?
The former leads to the following warning:
beyond.d(605,30): Deprecation: cannot take address of `scope` variable `this` since `scope` applies to first indirection only
beyond.d(605,30): Deprecation: cannot take address of `scope` variable `this` since `scope` applies to first indirection only
(and why is the deprecation message printed twice?)