← Back to index
|
Original Bugzilla link
Bug 21924 – Internal compiler error with @live
Status
RESOLVED
Resolution
WORKSFORME
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2021-05-15T13:54:35Z
Last change time
2023-01-28T15:27:08Z
Keywords
live
Assigned to
No Owner
Creator
lempiji
Comments
Comment #0
by lempiji — 2021-05-15T13:54:35Z
this code has internal compiler error with -preview=dip1021. ``` struct Handle { private void* handle; @disable this(); @disable this(this); this(int n) { handle = malloc(10); } void close() { free(handle); } } void main() { scope h = Handle(10); h.close(); } ``` The reason is in `isBorrowedPtr`. ``` return v.isScope() && !v.isowner && v.type.nextOf().isMutable(); //v.type.nextOf() is null ``` `isReadonlyPtr` too: ``` return v.isScope() && !v.type.nextOf().isMutable(); // v.type.nextOf() is null ```
Comment #1
by nick — 2023-01-28T15:27:08Z
run.dlang.io reports that it works from 2.089.1 and I can't reproduce it with v2.101.0.