digitalmars.D.learn - Defining classes with cyclic dependencies
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (8/8) Mar 17 2024 I was surprised that the compiler cannot compile
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (3/11) Mar 17 2024 Ahh, nevermind. I defined these inside a unittest scope so that's
I was surprised that the compiler cannot compile
```d
class A { B b; }
class B { C c; }
class C { D d; }
class D { A a; }
```
. Shouldn't it?
Mar 17 2024
On Sunday, 17 March 2024 at 20:38:16 UTC, Per Nordlöw wrote:
I was surprised that the compiler cannot compile
```d
class A { B b; }
class B { C c; }
class C { D d; }
class D { A a; }
```
. 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.
Mar 17 2024








Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com>