On Fri, Oct 23, 2020 at 8:20 AM frame via Digitalmars-d <digitalmars-d@puremagic.com> wrote:  
 Even this is a "intelligent"
feature by the compiler for non reachable code like that loop,
it's still confusing. There are maybe situations while the object
should stay in background, eg. socket related/event stuff. If
there is a valid pointer, there is no excuse to reap it.


There is no use of foo anywhere so there is no reason to not collect it. You even does not need to have while in your code:

void main() {
     auto foo = Bar.create();
     writefln("address: %s", foo.__vptr);
     GC.collect();
     Thread.sleep(1.seconds);
     //foo.sayHello(); // if uncommented GC would not call destructor until end of main
}