[Issue 24325] Type inference has precedence over written type when using `static`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 8 16:23:02 UTC 2024


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

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |nick at geany.org

--- Comment #1 from Nick Treleaven <nick at geany.org> ---
Error with v2.106 is:

Error: cannot implicitly convert expression `__lambda1` of type `typeof(null)
function() pure nothrow @nogc @safe` to `immutable(string function())`

So `CBType[]` is not ignored, but it is not used to infer the type of the
template lambda.

> If `static immutable` is dropped, it compiles

Or when just `static` is dropped.

--


More information about the Digitalmars-d-bugs mailing list