[Issue 20322] New: checkaction=context fails for wstring/dstring arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 26 11:08:16 UTC 2019


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

          Issue ID: 20322
           Summary: checkaction=context fails for wstring/dstring
                    arguments
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: moonlightsentinel at disroot.org

Some unittests from core.internal.unittest.d fail to compile with -unittest
-checkaction=context, e.g:

src/core/internal/dassert.d(31): Error: forward reference to inferred return
type of function call function () @trusted => cast(string)buffer()
src/core/internal/dassert.d(116): Error: cannot implicitly convert expression
idup(s) of type wstring to string
src/core/internal/dassert.d(216): Error: template instance
core.internal.dassert.miniFormat!wstring error instantiating
src/core/internal/dassert.d(17):        instantiated from here:
miniFormatFakeAttributes!wstring
src/core/internal/utf.d(885):        instantiated from here:
_d_assert_fail!("==", wstring, wstring)
src/core/internal/dassert.d(31): Error: forward reference to inferred return
type of function call function () @trusted => cast(string)buffer()
src/core/internal/dassert.d(116): Error: cannot implicitly convert expression
idup(s) of type dstring to string
src/core/internal/dassert.d(216): Error: template instance
core.internal.dassert.miniFormat!dstring error instantiating
src/core/internal/dassert.d(17):        instantiated from here:
miniFormatFakeAttributes!dstring
src/core/internal/utf.d(887):        instantiated from here:
_d_assert_fail!("==", dstring, dstring)
src/core/internal/dassert.d(31): Error: forward reference to inferred return
type of function call function () @trusted => cast(string)buffer()
src/core/internal/dassert.d(116): Error: cannot implicitly convert expression
idup(s) of type wstring to string


The is caused by miniFormat assuming that the result of a string concenation is
always a string (not e.g. a wstring)

--


More information about the Digitalmars-d-bugs mailing list