ID:2887169
 
Resolved
Debug information was incorrect for the last line of files that didn't end with a line break.
BYOND Version:515.1610
Operating System:Windows 11 Home 64-bit
Web Browser:Firefox 116.0
Applies to:Dream Maker
Status: Resolved (515.1615)

This issue has been resolved.
Descriptive Problem Summary: .dm files without line breaks at the end throw vague debug information in runtime errors, referring to incorrect problem files.

Numbered Steps to Reproduce Problem:
1. enable debug mode.
2. have a file with code in it that does not end in a line break.
3. make something in the code throw a runtime error.
4. look at debug information with runtime.

Expected Results: Correct/more reliable debug information.

Actual Results: Vague debug information.

When does the problem NOT occur? When there's a line break at the end of the relevant file.


Relevant information and test case provided over Discord.
Lummox JR resolved issue with message:
Debug information was incorrect for the last line of files that didn't end with a line break.
Test project included.

The only thing I've done here is add this to the DME:

#ifdef __MAIN__
#include "demo\demo.dm"
#endif


demo.dme
#include "#defines.dm" //this should generate a compiler error, but fails to do so.


This should fail because demo should not be able to find #defines.dm. I have FILE_DIR off.

but if I press enter:
#include "#defines.dm" //this should generate a compiler error, but fails to do so.
<newline here>


I get the proper compiler error. I've seen people suggesting that we need to include an extra newline at the bottom of all files, and that this kind of thing is normal. This is not great UX. if the compiler expects us not to terminate files at the end of a line without a break, the compiler needs to add the newline itself.
In response to Ter13
This turned out to be a duplicate of the other end-of-file issue, so I've combined them. It just manifested in a different way.