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.
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.
Hello! Thank you for the report. I tried to replicate your place with your provided scripts, but I am not quite able to reproduce your crash. If possible, could you provide the exact place file where the crash occurs?
The types are definitely strange, I am able to replicate that. We are aware that the new solver can sometimes produce strange looking types and are working on improving the user experience.
I’ll go give my scripter a dm the now Dev4523, to give you a DM privately so yous can get this issue fixed, thank you for getting back to us so quick
I have tried to reproduce my own bug, but it doesn’t crash anymore. I suppose you could consider this fixed for my specific case, but I’ve noticed other people in this topic having a similar issue.
Though, I still think the types that were generated by the type solver are kind of strange. I don’t think I did anything wrong in my Set class (which you can check out and review if you have the time).
For that, I am thinking the culprit might be how I define my Set type, which I consider the intersection between {[E]: boolean} and the Set table:
Hey, if you still have the current place file that the crash happened, send him a private DM and send him the file if you can, makes it easier for them, You the man!
I have tried to reproduce my own bug, but it doesn’t crash anymore. I suppose you could consider this fixed for my specific case, but I’ve noticed other people in this topic having a similar issue.
Yep! Crashes are a big category of issues and they could happen for all sorts of reasons. I have a reproduction for a crash from another place file.
Thanks for letting us know! I believe the issue in this thread has been root caused, with a fix on the way. I don’t believe it’s related to non-strict mode. If you have a repro that you’re comfortable sharing; either a place file or an individual script; we can take a look if you open a separate bug report.