[Issue 21614] compiled imports: core.exception.AssertError at src/dmd/semantic3.d(812): Assertion failure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 6 17:52:26 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21614

--- Comment #4 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Iain Buclaw from comment #2)
> In the unreduced test, a function that is marked `inferRetType` has a return
> statement, but the return type is inferred as `void` (possibly because
> semantic never finished for it).  Hence the assert is triggered.
This assumption was wrong.  What really happens is that there's a constructor
marked as `inferRetType`.  It's body is empty so it is inferred `void`.  Then
an automatic `return this` statement is appended to the body (because it
isCtorDeclaration), and an assert is triggered because the return type is
`void`.

--


More information about the Digitalmars-d-bugs mailing list