https://issues.dlang.org/show_bug.cgi?id=18606
John Colvin changed:
What|Removed |Added
CC||john.loughran.colvin@gmail.
||com
--- Comment #3 from John Colvin ---
Related:
struct S
{
string get(string key)
{
return key;
}
alias get this;
}
void main()
{
S[] a;
auto b = a.dup;
}
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4473): Error: mutable
method onlineapp.S.get is not callable using a const object
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4473):
Consider adding const or inout to onlineapp.S.get
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4460): Error:
template instance `object._dup!(const(S), S)` error instantiating
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4424):
instantiated from here: _trustedDup!(const(S), S)
onlineapp.d(13):instantiated from here: dup!(S)
and
struct S
{
string get(string key) const
{
return key;
}
alias get this;
}
void main()
{
S[] a;
auto b = a.dup;
}
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4473): Error:
function onlineapp.S.get(string key) const is not callable using argument types
() const
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4473):missing
argument for parameter #1: string key
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4460): Error:
template instance `object._dup!(const(S), S)` error instantiating
/dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4424):
instantiated from here: _trustedDup!(const(S), S)
onlineapp.d(13):instantiated from here: dup!(S)
--