A line with mixed indentation (1 space + 2 tabs) compiles without error, but the code on that line does not execute. The compiler only reports an "inconsistent indentation" error after adding a line of code (e.g. logging) directly above it.
Numbered Steps to Reproduce Problem:
1. Create a line with mixed indentation (e.g. 1 space + 2 tabs).
2. Leave a blank line above it (just press Enter).
3. Compile — no error appears.
4. Add any line of code (e.g. logging) above the affected line.
5. Compile again — now an "inconsistent indentation" error appears.
Code Snippet (if applicable) to Reproduce Problem:
/*
These are simple defaults for your project.
*/
/mob/test
var/grid_height = 1
var/grid_width = 1
var/w_class = 5
/mob/test/proc/test()
if(!pixel_x && !pixel_y)
pixel_x = rand(-5,5)
pixel_y = rand(-5,5)
if(grid_width <= 0 || !grid_width)
grid_width = (w_class * world.icon_size)
if(grid_height <= 0 || !grid_height)
grid_height = (w_class * world.icon_size)
Expected Results:
Compiler should report inconsistent indentation regardless of whether there is code above the affected line.
Actual Results:
No error is shown unless there is code directly above the line with mixed indentation. When a line is added, the compiler correctly reports the error.
Does the problem occur:
Every time? Or how often? Every time
In other games? Not tested
In other user accounts? Not tested
On other computers? Yes
When does the problem NOT occur?
When there is a code line above the affected line — the compiler then detects the issue as expected.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
Tested on 515.1647 and 516.1660 — issue occurs in both.
Workarounds:
Insert a line of code before the affected line to trigger indentation checking, or reformat indentation consistently using either tabs or spaces.
I also attached a link to the code on Pastebin in case spaces and tabs aren't preserved properly in this form: https://pastebin.com/1FVTubQE
I confirmed that this is happening in 516.1660, and uploaded a test case to BYONDiscord here.