On Wednesday, 23 September 2020 at 19:27:13 UTC, Steven Schveighoffer wrote:
This is a bug in the language.

Is this a known bug? If not, it should be reported.

I came up with an answer to my original question that sort of works:

---
module foo;

struct Foo
{
  private int x;
}

int x(Foo f)
{
  return f.x;
}
---

The downside is that if I don't want to import all of foo at once, then I have to import both Foo and x, but then I can read x from outside the module and modify it form inside as I wanted. Are there any drawbacks of this approach that I'm not seeing?

Reply via email to