Skip to content

Conversation

karl-police
Copy link
Contributor

@karl-police karl-police commented Sep 11, 2024

#1309
#1389

There is a Unit Test, I hope it explains it.

Now the thing is, writeTy is nullopt only in the New Type Solver.

When a property is only read from in the old type solver for some reason it also gets a writeTy assigned, hence why this fix only works for the new type solver 🤷

And when a property is written to writeTy is empty in the old solver no clue how.

 

I do know that this fix doesn't work if the FreeType is getting intersected with anything else, but... you'd loop through the intersection type I guess.

I didn't fix it because I ran into a bug that wasn't caused by this change. Which can be found here: #1391

Summary

If you have a TableType with TableState:Free doing an autocomplete is actually going to fill up the propeties that were never written to, into the entryMap as well.

And this should prevent that from happening. This shouldn't ruin function table based autocompletes.

 

The purpose of Free Table types is to have unsealed tables work anywhere. You can't actually create a Free Table type with Luau syntax I think. At least yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant