D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8296 - @disable this propagates through reference
Summary: @disable this propagates through reference
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2012-06-25 07:17 UTC by Benjamin Thaut
Modified: 2014-03-31 19:19 UTC (History)
0 users

See Also:


Attachments
repro case (526 bytes, application/zip)
2012-06-25 07:17 UTC, Benjamin Thaut
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Benjamin Thaut 2012-06-25 07:17:05 UTC
Created attachment 1120 [details]
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 Benjamin Thaut 2013-10-13 02:12:03 UTC
Still an issue in 2.064 beta 1
Comment 3 github-bugzilla 2014-03-31 18:54:32 UTC
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)