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
Still an issue in 2.064 beta 1
https://github.com/D-Programming-Language/dmd/pull/3411
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)