Studio Crashes when function is called from a typed variable (autocompletion)

Since this crash is difficult to explain i’m going to start with a code sample and unpack it (scroll down for proper repro steps)

module 1:

export type foo = "a" | "b" | "c"

local function bar()

	local module2 = require(script.Parent.module2)
	type otherType = module2.otherType

	local otherTypeVar: otherType = nil
	
	otherTypeVar:baz(type anything but a string as an arg) -- crashes studio

end

module 2:

local module1 = require(script.Parent.module1)

export type otherType = {
	baz: (module1.foo) -> nil
}

what crashes studio is typing otherTypeVar:baz() and then typing something (anything besides a string) as an argument. otherTypeVar is of the type otherType, which is defined in module 2 as a table containing a function, which is baz: (module1.foo) -> nil (where module1.foo is the type foo defined in module 1), although the actual value of otherTypeVar doesn’t matter. An important thing to note here is that types foo and otherType are stored in different modules.

I also tried replicating this bug where the code in module 1 isn’t inside of a function, but nothing happened. The bug also didn’t occur if these lines were outside of the function bar:

local module2 = require(script.Parent.module2)
type otherType = module2.otherType

Reproduction Steps

  • download and open this place file:
    Bug_repro_ide.rbxl (44.9 KB)
  • open module1, which is located in ServerScriptService
  • type otherTypeVar:baz(type anything here besides a string) below the comment on line 10
  • observe how what you typed doesn’t have an orange underline if it isn’t a valid variable
  • after a moment observe how studio has crashed (but you can still use it as far as i can tell, it’s only the autocomplete that stops working, even though the crash message appears)

Workarounds

  • writing the code the causes the crash as a comment then copying and pasting it

Crash Dump: https://devforum.roblox.com/t/crash-logs/2474382

Issue Area: Studio
Issue Type: Autocomplete
Impact: High
Frequency: Constantly
Date First Experienced: 2023-07-17 16:42 (+10:00)
Date Last Experienced: 2023-07-18 20:15 (+10:00)

1 Like

Thank you for the bug report. We have been able to reproduce the crash and are investigating a fix. We will reach back out if we need any more information.

Edit: As a temporary workaround, the bug seems to be triggered through Signature Help, which can be disabled through Studio Settings → Script Editor → Enable Signature Help.

6 Likes

We have a fix ready for this internally, it will get into one of the future updates.

3 Likes

The fix is now live and the issue has been fixed.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.