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

Handle cyclically referenced declared classes #729

Merged
merged 8 commits into from
Nov 28, 2022

Conversation

JohnnyMorganz
Copy link
Contributor

Closes #631

Performs a "two pass" approach, where we first call prototype on the class definition.
The prototype phase checks for errors and creates a base CTV for the class, which other types can then reference.

The second check phase fills it out with all the defined properties/methods

@JohnnyMorganz
Copy link
Contributor Author

I assume a change like this probably needs a FFlag? Let me know if so

@andyfriesen
Copy link
Collaborator

Hello!

Yes, this certainly does need a FFlag.

I think the change looks ok otherwise.

@JohnnyMorganz
Copy link
Contributor Author

I wasn't sure on the best way to cleanly separate the FFlag, so its a bit duplicated right now. Let me know if there are better ways

@dmi7ry
Copy link

dmi7ry commented Nov 25, 2022

review/merge, please?

@JohnnyMorganz
Copy link
Contributor Author

Coverage job seems to be broken, unrelated to this PR

@vegorov-rbx vegorov-rbx merged commit 7dbe47f into luau-lang:master Nov 28, 2022
@JohnnyMorganz JohnnyMorganz deleted the ctv-forward-declare branch November 28, 2022 15:13
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.

Class definitions cannot handle cyclically referenced types
4 participants