Luau typechecked script seems to crash studio consistently

When making a script using the --!script line at the type and the luau type checking beta enabled, studio seems to crash on certain lines without any information on as to why.

The if statement indicated here seems to always crash studio, either after finishing the if statement and appending another line/ adding an else, or otherwise. This script include some hand made models that are too heavily “typed”, and those models seem to influence the crashes.

Displaying the models would be a quite troublesome, seeing as they are rather large, but i’d assume the fact that a fair bit uses typeof() for declaring types of objects in the module, might be a clue.

Not sure how to further progress, as its rather annoying and can occur on certain lines, consistently (so far had an occurrence twice, had to program around the crash.

Some more screenshot(s)

Your while loop looks a little problematic to me. If item[1] is guaranteed to exist when item exists, the if statement is not necessary. If item[1] is not guaranteed to exist when item exists, the loop is not guaranteed to finish, as it’ll just repeatedly check for the missing item[1].

You have a while loop without a wait() function. This generally causes Studio to crash on some occasions. Simply put a wait() or task.wait() to make it not crash anymore. Works for me.

1 Like

Yes, that’ll prevent the crashes. However, even if it doesn’t cause studio to crash anymore, an infinite loop that does nothing useful is still a bad thing. The problem that can make the loop infinite is that the loop can only finish if item[1] exists. I’m not even sure how exactly the loop is supposed to work. It should apparently find and return a Match but the only return statement in the function is return nil in the end of the function.

My bad on not reiterating on my question, by crashing I mean it tends to crash when not even play testing.

Its not an issue of the loop per-se, and I do genuinely know the issues wrong with the loop, its not the loop thats crashing studio though, its the act of type that if-statement (while not playtesting) that results in the crash. This would better fit in the bugs category (as it seems to be a luau typechecker bug itself), but I do not have permissions to post there (I also do intend to break the loop with an else in the if statement, if the act of typing the statement did not crash studio)

(also some information on the reason why my code is typed this way, item is a linked list, where element 1 is the next item in the list. I could probably toss the if statement in the while loop itself, or not do a while loop, but the mere act of typing the if statement (while not playtesting) should not crash studio under normal circumstances, I know that if I were to playtest, it would most likely crash.)

I included the output of the console to attempt to show studio crashing while not playtesting, the line StartProcessException usually appears when studio crashes in output, playtesting or not.

Look at my reply to hans5915, to summarize, this is not while playing/testing the game itself, its in the editor of studio while making the script. Upon writing that if-statement (and in the past some other lines) studio just crashes. This would be better suited to the bugs category as im somewhat sure its a luau typechecker bug itself, especially because some of my --!strict modules when not required do not cause the crash anymore.

Essentially its more-over a bug with studio then it is with the script itself (though I would bet some of the script has to do with why its crashing as I am typing it out).