Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix definition module name & location #1495

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

checkraisefold
Copy link
Contributor

Closes #1441

Brings behavior to parity with the old solver by filling in definitionLocation and definitionModuleName for Luau-consuming programs/libraries to use.

@checkraisefold
Copy link
Contributor Author

I haven't a clue how exactly this caused the tests to fail. I'll have a look later today

@vegorov-rbx
Copy link
Collaborator

New solver error messages now include the type definition location when they didn't have that info before.

@checkraisefold
Copy link
Contributor Author

New solver error messages now include the type definition location when they didn't have that info before.

I see - is the best approach to just change the test, then?

@checkraisefold
Copy link
Contributor Author

For the module_type_conflict_instantiated test, the definition module names are incorrect. Will have to spend some time looking into this

@checkraisefold
Copy link
Contributor Author

I recall why I didn't implement this before. TypeAliasExpansionConstraint in particular was tough to come up with anything resembling a decent solution. But I think I've come up with something that doesn't suck here, and should be a correct implementation. More importantly, it works and the tests pass - I don't see any possible issues with the solution.

Copy link
Collaborator

@aatxe aatxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be flagged (just with a normal fflag, we're sunsetting the DFInt), but otherwise looks fine.

const IterableConstraint& c,
NotNull<const Constraint> constraint
)
bool ConstraintSolver::tryDispatchIterableFunction(TypeId nextTy, TypeId tableTy, const IterableConstraint& c, NotNull<const Constraint> constraint)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this formatting change coming from clang-format?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, can be reverted if you like

@@ -1433,7 +1438,8 @@ bool ConstraintSolver::tryDispatch(const FunctionCheckConstraint& c, NotNull<con
}
}
}
else if (expr->is<AstExprConstantBool>() || expr->is<AstExprConstantString>() || expr->is<AstExprConstantNumber>() || expr->is<AstExprConstantNil>())
else if (expr->is<AstExprConstantBool>() || expr->is<AstExprConstantString>() || expr->is<AstExprConstantNumber>() ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this formatting change coming from clang-format?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, can be reverted if you like

@checkraisefold
Copy link
Contributor Author

This needs to be flagged (just with a normal fflag, we're sunsetting the DFInt), but otherwise looks fine.

flag gated

Copy link
Collaborator

@aatxe aatxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, cheers!

@aatxe aatxe merged commit 9a4bc6a into luau-lang:master Nov 5, 2024
7 checks passed
@checkraisefold checkraisefold deleted the fix-def-module-name branch November 5, 2024 20:33
aatxe added a commit that referenced this pull request Nov 5, 2024
)

Follow up to #1495: a small fixup for the defining module and location
to get set even when cloning was required.
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.

definitionModuleName is undefined for table type aliases
3 participants