Bug 17749 – Compilation error "shared method ~this is not callable using a non-shared object" on shared object
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-08-12T18:11:29Z
Last change time
2018-03-27T09:42:43Z
Assigned to
No Owner
Creator
Arkadiusz RychliĆski
Comments
Comment #0 by arychlinski — 2017-08-12T18:11:29Z
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.
Comment #1 by razvan.nitu1305 — 2018-03-27T08:18:17Z
This was fixed in git HEAD (DMD64 D Compiler v2.079.0-218-g54ab04e). Closing as fixed.