Bug 12790 – Compiler should keep mixin file around for debugging purposes

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-23T15:01:20Z
Last change time
2019-08-30T16:16:53Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Andrej Mitrovic

Comments

Comment #0 by andrej.mitrovich — 2014-05-23T15:01:20Z
Possibly duplicate report, but I want to discuss this: ----- string someCode() { return " int x; int y = a; // bug "; } mixin(someCode()); void main() { } // L11 ----- 2.064.2: $ dmd test.d > test.d(11): Error: undefined identifier a, did you mean variable x? 2.065: $ dmd test.d > test.d-mixin-9(11): Error: undefined identifier a I assume this was changed in order to avoid using confusing error line numbers in the original file (L11 is not really appropriate for any tooling support in 2.064.2). However, this change still isn't helpful because we do not **have** the 'test.d-mixin-9' file. Is it stored on disk somewhere and then promptly deleted? Or is the diagnostic just faking by saying there's a 'test.d-mixin-9' file? I think the compiler should actually create this file (maybe in a temporary dir), and then users will be able to instantly jump-to the point of the mixin where there is some invalid code. This would avoid having to inject pragma(msg) statements.
Comment #1 by github-bugzilla — 2018-11-07T01:39:29Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3bbb228f3f1239058e4451946554b174dd0a85e1 Fix issues 1870 and 12790: Write out string mixin code to a file for debugging purpose https://github.com/dlang/dmd/commit/34db7419c8bbf7487ecd8e7a4eb6adb6fc0bbb74 Merge pull request #8677 from thewilsonator/mixin-debug Fix issues 1870 and 12790: Write out string mixin code to a file for debugging purpose
Comment #2 by r.sagitario — 2019-08-30T16:16:53Z
*** Issue 5051 has been marked as a duplicate of this issue. ***