The following struct has two functions, one marked as const and the other marked as inout. Note that both calls in main are in error: they lack an argument. struct S { void is_const(int) const {} void is_inout(int) inout {} } void main() { const s = S(); s.is_const(); s.is_inout(); } The error message for the first one is correct because it mentions the mismatched argument list: Error: function deneme.S.is_const (int _param_0) const is not callable using argument types () const However, the error message for the second call is misleading: Error: inout method deneme.S.is_inout is not callable using a const object Ali
Very frustrating as `inout` is not an obvious language feature (I mean all these implicit conversions) and the error will misguide lots of coders.
still present in 2.075
Works as expected with 2.088. Now both errors are reported equally: deneme.d(571): Error: function `deneme.S.is_const(int _param_0) const` is not callable using argument types `() const` deneme.d(571): missing argument for parameter #1: `int _param_0` deneme.d(572): Error: function `deneme.S.is_inout(int _param_0) inout` is not callable using argument types `() const` deneme.d(572): missing argument for parameter #1: `int _param_0`