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

Throw an exception when attempting to register an abstract class #6307

Merged

Conversation

takejohn
Copy link

@takejohn takejohn commented Jan 7, 2024

Description

Registering an abstract class as a syntax element doesn't cause any errors;
however, parsing a code matching it will fail with an error like "Can't understand this ..."
I'd like to add a check on the constructor parameter of SyntaxElementInfo for abstract classes so an addon developer can notice what's wrong with their addon.


Target Minecraft Versions: any
Requirements: none
Related Issues: none

@TheLimeGlass
Copy link
Collaborator

There are ClassInfos such as Projectile that are registered as abstract classes

@takejohn
Copy link
Author

takejohn commented Jan 8, 2024

There are ClassInfos such as Projectile that are registered as abstract classes

I believe ClassInfos are okay to be registered as abstract class if Skript doesn't need to instantiate them.
I want to change SyntaxElements, which are necessary to be instantiated by Skript.

@sovdeeth sovdeeth added enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. 2.9 Targeting a 2.9.X version release labels Jan 8, 2024
@sovdeeth
Copy link
Member

sovdeeth commented Jan 8, 2024

Marked as feature-ready, but I believe this is fine for a patch as well.

@sovdeeth sovdeeth changed the base branch from master to dev/feature January 8, 2024 02:43
@APickledWalrus APickledWalrus merged commit ae1f465 into SkriptLang:dev/feature Mar 9, 2024
4 checks passed
@takejohn takejohn deleted the feature/abstact_class_error branch March 10, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.9 Targeting a 2.9.X version release enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants