I was working on a Set class using the new Luau type solver beta and using --!strict mode. I then made another Script to check out if it worked with the Luau type solver. So I wrote the following code to see if it worked. I first created two sets with the same value (specifically the workspace
), then joined them together to create mergedSet
, then converted it to an array. Then I wanted to check if the firstItem
in the array would autocomplete workspace stuff, but instead it crashed my studio!! It happens every time as well.
Here is the code I tried to test it with:
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Set = require(ReplicatedStorage.Library.Core.Collections.Set)
local mySet = Set.new(workspace)
local otherSet = Set.new(workspace)
local mergedSet = mySet:Join(otherSet)
local array = mergedSet:ToArray()
local firstItem = array[1]
print(firstItem.)
I also noticed very strange types for my sets and variables.
Types
local mySet
local otherSet
local mergedSet
local array
local firstItem
For staff, please refer to the Set class for better clarification.
Set class code
The Set class will be available to staff only, sorry.
System Information:
CPU: AMD Ryzen 5 5500
Memory: 16GB
GPU: NVIDIA GeForce RTX 3060
Expected behavior
I expected firstItem
to have a Workspace
type as the set’s type would have been Set<Workspace>
. Similarly, I expected the autocomplete to work and not crash my Studio.
A private message is associated with this bug report