fix Issue 13152 - Compiler high cpu usage and never ends

Partially revert "Merge pull request #2448 from hpohl/10752"
Merge pull request #3790 from 9rnsr/fix13152

[REG2.064] Issue 13152 - Compiler high cpu usage and never ends
fix Issue 13158 - "void has no value" in std.variant.Algebraic (affects D:YAML)
Merge pull request #3793 from 9rnsr/fix13158

[REG2.066a] Issue 13158 - "void has no value" in std.variant.Algebraic (affects D:YAML)