I was surprised that the compiler cannot compile
class A { B b; }
class B { C c; }
class C { D d; }
class D { A a; }
. Shouldn't it?
March 17 Defining classes with cyclic dependencies | ||||
---|---|---|---|---|
| ||||
I was surprised that the compiler cannot compile
. Shouldn't it? |
March 17 Re: Defining classes with cyclic dependencies | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On Sunday, 17 March 2024 at 20:38:16 UTC, Per Nordlöw wrote: >I was surprised that the compiler cannot compile
. Shouldn't it? Ahh, nevermind. I defined these inside a unittest scope so that's why it failed. Defining them at module scope works just fine. |