[Issue 22300] New: [REG 2.098-rc.2] `-checkaction=context` of a `shared` type with an `opCast` fails to compile

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 13 08:22:29 UTC 2021


          Issue ID: 22300
           Summary: [REG 2.098-rc.2] `-checkaction=context` of a `shared`
                    type with an `opCast` fails to compile
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: pro.mathias.lang at gmail.com

struct Fail
    int value;

    @safe pure nothrow @nogc:
    bool opCast () shared const scope { return true; }

void main ()

Compiled with `~/dlang/ldc-36198b36/bin/ldc2 -checkaction=context -run wat.d`:
Error: cannot implicitly convert expression `v.opCast()` of type `bool` to
Error: template instance `core.internal.dassert.miniFormat!(shared(Fail))`
error instantiating
   instantiated from here: `miniFormatFakeAttributes!(shared(Fail))`
wat.d(11):        instantiated from here: `_d_assert_fail!(shared(Fail))`

Worked fine in v2.097.0. Affects vibe-core so it's pretty serious.


More information about the Digitalmars-d-bugs mailing list