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