luau icon indicating copy to clipboard operation
luau copied to clipboard

Missing dependency fix for Type Functions

Open karl-police opened this issue 1 year ago • 3 comments

An alternate version of my fix for https://github.com/luau-lang/luau/pull/1418

Where instead of changing the positions, I block the dependencies.

As the actual solution concept is just this: https://github.com/luau-lang/luau/pull/1418#issuecomment-2357268739

The solution is to block all constraints that depend on the pending-expansion that is being expanded, on the resolution of the reduction constraint that is being created.

karl-police avatar Sep 18 '24 15:09 karl-police

Though if the positions can also be forced at the location it would make certain solving faster :person_shrugging:

Let me know if I should change anything 🤷

karl-police avatar Sep 18 '24 16:09 karl-police

image

welp

karl-police avatar Sep 18 '24 16:09 karl-police

@vegorov-rbx What can I do?

I recently tried to look again into this issue. The method I put here still works.

 

But I made a comparison to a user-defined type function KeyOf with the regular keyof.

And for some reason the user-defined type function doesn't have this issue. But I can't figure out why :(

Why do user-defined type functions not have this issue? I've set so many breakpoints I can't figure out, there's a lot going on in this. And unlike me blocking things. user-defined type functions put the dependency directly inside of the type somehow, I don't know how. I don't know. :(

 

See the difference, right works and is using a user-defined type function left is without this PR and using regular keyof image

https://www.diffchecker.com/0OyWfSsK/

https://paste.ivr.fi/fadymiluwy.json https://paste.ivr.fi/uhulekebur.json

karl-police avatar Feb 24 '25 15:02 karl-police