On Thursday, 30 August 2018 at 12:18:10 UTC, Elie Morisse wrote:
On Monday, 11 June 2018 at 15:41:57 UTC, Steven Schveighoffer
wrote:
I filed a bug about a similar thing (calling private functions
instead of using private variables), but it seemed to be
agreed upon that this is expected
On Monday, 11 June 2018 at 15:41:57 UTC, Steven Schveighoffer
wrote:
I filed a bug about a similar thing (calling private functions
instead of using private variables), but it seemed to be agreed
upon that this is expected behavior:
https://issues.dlang.org/show_bug.cgi?id=15897
You may find
On Monday, 11 June 2018 at 15:41:57 UTC, Steven Schveighoffer
wrote:
On 4/11/18 3:13 PM, bauss wrote:
On Wednesday, 11 April 2018 at 17:58:25 UTC, Jonathan M Davis
wrote:
On Sunday, April 08, 2018 13:00:02 bauss via Digitalmars-d
wrote:
[...]
I don't know. It could be argued either way. I
On 4/11/18 3:13 PM, bauss wrote:
On Wednesday, 11 April 2018 at 17:58:25 UTC, Jonathan M Davis wrote:
On Sunday, April 08, 2018 13:00:02 bauss via Digitalmars-d wrote:
[...]
I don't know. It could be argued either way. I think that the logic as
to why
[...]
The thing is, it makes no
On Wednesday, 11 April 2018 at 17:58:25 UTC, Jonathan M Davis
wrote:
On Sunday, April 08, 2018 13:00:02 bauss via Digitalmars-d
wrote:
[...]
I don't know. It could be argued either way. I think that the
logic as to why
[...]
The thing is, it makes no sense why it shouldn't be legal since
On 11.04.2018 19:58, Jonathan M Davis wrote:
I don't know. It could be argued either way.
Not really. bauss is right about this.
https://en.wikipedia.org/wiki/Liskov_substitution_principle
, 7 April 2018 at 20:14:49 UTC, bauss wrote:
> >>>> jesus that became a long title.
> >>>>
> >>>> Anyway as the title says, is it a bug that a parent class
> >>>> that access its own private members from derived classes
>
On Wednesday, 11 April 2018 at 17:20:23 UTC, martin wrote:
On Monday, 9 April 2018 at 17:16:56 UTC, bauss wrote:
On Monday, 9 April 2018 at 17:05:45 UTC, martin wrote:>>
Actually, this behaves as i would expect.
`_baz` is a private member of Foo (to be precise: it belongs
to module `a`)
in
On Wednesday, 11 April 2018 at 17:34:40 UTC, bauss wrote:
On Wednesday, 11 April 2018 at 17:20:23 UTC, martin wrote:
On Monday, 9 April 2018 at 17:16:56 UTC, bauss wrote:
On Monday, 9 April 2018 at 17:05:45 UTC, martin wrote:>>
Actually, this behaves as i would expect.
`_baz` is a private
On Monday, 9 April 2018 at 17:16:56 UTC, bauss wrote:
On Monday, 9 April 2018 at 17:05:45 UTC, martin wrote:>>
Actually, this behaves as i would expect.
`_baz` is a private member of Foo (to be precise: it belongs
to module `a`)
in handleBar(), you iterate `Bar[]` - which is in module `b`.
By
On Monday, 9 April 2018 at 17:05:45 UTC, martin wrote:
On Sunday, 8 April 2018 at 13:00:02 UTC, bauss wrote:
I think it's better demonstrated like this, because to me the
behavior makes no sense.
Especially since you can just cast "Bar" to "Foo" and then
you're allowed to do it.
Since
On Sunday, 8 April 2018 at 13:00:02 UTC, bauss wrote:
I think it's better demonstrated like this, because to me the
behavior makes no sense.
Especially since you can just cast "Bar" to "Foo" and then
you're allowed to do it.
Since we're inside Foo then it shouldn't care whether "_baz" is
On Sunday, 8 April 2018 at 14:45:34 UTC, kdevel wrote:
On Sunday, 8 April 2018 at 13:00:02 UTC, bauss wrote:
[...]
// a.d
module a;
class Foo
{
private:
bool _baz;
public:
void handleBar(T : Foo)(T[] foos)
{
foreach (child;
On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote:
jesus that became a long title.
Anyway as the title says, is it a bug that a parent class that
access its own private members from derived classes gets
deprecation warning?
Scenario narrowed down:
// module foo;
class Foo
On 08.04.2018 16:36, Timon Gehr wrote:
On 08.04.2018 15:00, bauss wrote:
It's perfectly normal in other languages that supports classes to
access private members of parent's as long as you're within the
parent's encapsulation.
That is not true. Use 'protected'.
Actually, I misunderstood
On Sunday, 8 April 2018 at 13:00:02 UTC, bauss wrote:
[...]
// a.d
module a;
class Foo
{
private:
bool _baz;
public:
void handleBar(T : Foo)(T[] foos)
{
foreach (child; foos)
{
child._baz
On 08.04.2018 15:00, bauss wrote:
It's perfectly normal in other languages that supports classes to access
private members of parent's as long as you're within the parent's
encapsulation.
That is not true. Use 'protected'.
, is it a bug that a parent class
that access its own private members from derived classes
gets deprecation warning?
If the import is selective no. (`import foo : Foo;`)
If the import is for the whole module i'd say yes. (`import
foo;`)
What do you mean?
The problem is that "Foo" cannot ac
On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote:
The above in my case will give a deprecation warning that
"_baz" isn't visible from "Bar".
Seems like a bug to me since I'm accessing "_baz" from "Foo"
itself and not from "Bar" or is it by design that you can't do
such thing.
I
On Saturday, 7 April 2018 at 20:46:39 UTC, bauss wrote:
On Saturday, 7 April 2018 at 20:34:57 UTC, user1234 wrote:
On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote:
jesus that became a long title.
Anyway as the title says, is it a bug that a parent class
that access its own private
On Saturday, 7 April 2018 at 20:34:57 UTC, user1234 wrote:
On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote:
jesus that became a long title.
Anyway as the title says, is it a bug that a parent class that
access its own private members from derived classes gets
deprecation warning
On Saturday, 7 April 2018 at 20:46:39 UTC, bauss wrote:
The problem is that "Foo" cannot access "_baz" without
deperecation warning, but "_baz" is a part of "Foo".
I'm not trying to access "_baz" directly from "Bar" except for
that I call the templated function that access "_baz", but that
On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote:
jesus that became a long title.
Anyway as the title says, is it a bug that a parent class that
access its own private members from derived classes gets
deprecation warning?
If the import is selective no. (`import foo : Foo
On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote:
foreach (child; values)
{
child._isChild = true;
}
I forgot: _isChild should be _baz in the narrowed down version.
jesus that became a long title.
Anyway as the title says, is it a bug that a parent class that
access its own private members from derived classes gets
deprecation warning?
Scenario narrowed down:
// module foo;
class Foo
{
private:
bool _baz;
public:
final void foos(T
25 matches
Mail list logo