Type Functions aren't designed for AssignPropConstraint? #1390
Unanswered
karl-police
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Somewhere I wanted to experiment with table types. https://github.com/karl-police/luau/blob/ca4f440b3818331293158c5d55f7ece98b98c4fa/Analysis/src/TypeFunction.cpp#L2359
While I am not sure if I've ever done this right. I'd run into an issue.
If I mixed this with
keyof
here's a few things that would happen.Let's assume this would be my Luau code put into a Unit Test.
Apparently this is what happens step by step:
tbl_C
gets createdtbl_C.entry3 = "abc"
triggered, thetryDispatch
function from ConstraintSolver.cppTypeId lhsType = follow(c.lhsType);
this happenslhsType
is going to be aTypeFunctionInstanceType
tryDispatch
will fail and returnfalse
, because it is blockedkeyof
gets triggered, but it won't have any keysentry3
gets added into that tableAnd what I don't understand is, if this is my fault or if this is something that yet has to be refined in Luau.
Beta Was this translation helpful? Give feedback.
All reactions