Bug 8296 – @disable this propagates through reference

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-25T07:17:00Z
Last change time
2014-03-31T19:19:50Z
Keywords
rejects-valid
Assigned to
nobody
Creator
code

Attachments

IDFilenameSummaryContent-TypeSize
1120repro.ziprepro caseapplication/zip526

Comments

Comment #0 by code — 2012-06-25T07:17:05Z
Created attachment 1120 repro case In the attached repro case the @disable this() in bar2 prevents bar1 from being initialized even though bar1 is not using bar2 directly. bar1 is only holding a reference to a class which uses bar2. Also the error message is really strange as it points to a line in the sourcecode where there should not be any initialization as the struct is return via reference. Tested with dmd 2.058 & 2.059 on windows
Comment #1 by code — 2013-10-13T02:12:03Z
Still an issue in 2.064 beta 1
Comment #2 by code — 2014-03-30T05:58:32Z
Comment #3 by github-bugzilla — 2014-03-31T18:54:32Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e89c88a57bdce5795598ea8b062f2ed717f09a81 Fixed "@disable this" propagating through references (issue 8296) https://github.com/D-Programming-Language/dmd/commit/b56d207bc6ece8709d26b5c2214d37c6fa9a4d5a Merge pull request #3411 from Ingrater/fix8296 Fixed "@disable this" propagating through references (issue 8296)