www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17749] New: Compilation error "shared method ~this is not

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

          Issue ID: 17749
           Summary: Compilation error "shared method ~this is not callable
                    using a non-shared object" on shared object
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: arychlinski gmail.com

Let's take the following code:

shared struct S
{
    int i;

    ~this()
    {
    }
}

void main()
{
    shared s = shared S();
}

DMD64 D Compiler v2.075.0 raises the error:
shtest.d(12): Error: shared method shtest.S.~this is not callable using a
non-shared object

ldc 1.3.0 compiles this code without errors.

--
Aug 12 2017