Draft
Conversation
…at runtime), and add ability to enforce that enums-to-be-extended implement given interface
|
Contributor
Author
|
Whoops, just realized I think there's some indexed-enum stuff or the like this needs to support, I'll add that to the TODO list too |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In light of the recent discussion on discord -- this seems like a useful thing to have in-source support for, right?
Like interface injection, JST has to generate stubs occasionally here -- for the
EnumProxyfields or parameter providing methods that enum extensions can use.This PR is marked as a draft for now. It is blocked by:
IndexedEnumand company supportgetParameterIn particular -- FML needs to handle cases where enum entries to be injected exist already gracefully, including handling ordering so that "dev env with source-injected plus runtime-injected-from-a-dependency enum entries" and "prod server being tested against" get the same enum ordering.
This system validates that the targeted class extends a provided interface (presumably, you'd pass it
IExtensibleEnumfor neoforge-mode, and nothing for "vanilla" mode).One question I have -- I currently hard-code the
EnumProxyclass used in stubs. Should this be un-hard-coded as an argument or the like?