Strict type checking causes studio to crash using certain scripts

When --!strict is at the top of certain scripts, it causes Studio to crash when loading the place. I have attached a file that consistently reproduces the issue on my machine:
dist.rbxlx (1.1 KB)

The contents of the scripts (both located in ReplicatedStorage) are below:

StructureUtil.lua

--!strict

local StructureUtil = {}

export type Snap = {
	instance: BasePart,
}

function StructureUtil:deleteSnap(snap: Snap)
	local snaps = self:getInstanceSnaps(snap.instance)
end

function StructureUtil:detachSnaps(snap1: Snap)
	self:deleteSnap(snap1)
end

function StructureUtil:attachSnaps()
	local c1

	local function destroy()
		if c1 then
			c1:Disconnect()
		end

		self:detachSnaps(snap1)
	end

	return destroy
end

return StructureUtil

ScriptB.lua

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StructureUtil = require(script.Parent.StructureUtil)

StructureUtil:attachSnaps()

This issue can be fixed by removing --!strict at the top of the first script, or removing the second script.

When it happens

I first noticed this issue today (08/02/23) when starting studio, though I had last opened studio about as week ago.

System Information

This has crashed studio on the machines of everyone I asked, but in case it’s relevant:

  • AMD Ryzen 7 5700X
  • AMD Radeon RX 6650 XT
  • 16.0 GB DDR4 @ 3600MHz

EDIT: As of 2023-08-04, which was when this bug report was approved, this issue no longer appears to occur.

1 Like

I’m happy to hear that is no longer occurring!

Thanks for the update!

1 Like