Allow bracketed expressions in ZenType declarations.#37
Allow bracketed expressions in ZenType declarations.#37eutro wants to merge 2 commits intoCraftTweaker:masterfrom
Conversation
This can reduce ambiguity and possibly allow for function arrays, or associatives with function keys, if `ZenTypeFunctionCallable#toJavaClass` ever gets implemented.
kindlich
left a comment
There was a problem hiding this comment.
Hm... not sure if I like that you made every array and map type be printed in brackets 🤔
Because people will be confused if it suddenly writes expected (IIngredient)[] what the () are for
|
Without the parentheses, stringifying Brackets are a common thing to group expressions, so I don't think people will be too confused, though I'll admit it might look ugly. |
|
It might make sense to have |
kindlich
left a comment
There was a problem hiding this comment.
Hm... I still wonder if we should add these () all the time, or only when needed?
Like, afaik, we only need them for the combination of arrays and functions.
So, thinking:
- We could have the array's name to only add the
()if it's a function - We could give ZenType a new method that determines if it needs them.
Sure, an extra set of brackets should not irritate experienced developers.
However, printing the type in another form than that which the user inserted can be irritating to especially new developers.
This can reduce ambiguity and possibly allow for function arrays, or associatives with function values, if
ZenTypeFunctionCallable#toJavaClassever gets implemented.