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 casting it to Foo, you are accessing the wanted module
but handleBar() is in a.
This behavior is allowed in ex. C#
`_baz` is a member of `module a : Foo` - `_baz`, as is
`protected` is the Access specifier you want.
If i understand you correctly, you want it to behave as if
`_baz` would be a member of `handleBar()`
If this is really possible in C#, it lets my eyebrow raise.