-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
children(type) to allow children only #65
Comments
I would suggest the following syntax DiplomaticAbility(Ability):
stances : set(DiplomaticStance, onlychildren=True) We could pass an arbitrary number of additional parameters or flags to complex types this way. It would probably work for nyan object references too: SomeObject():
some_member : OtherObject(onlychildren=True) We don't even have to define |
This was an earlier thought, but for the type checker it's easier to define Your two examples would also need two different implementations - one for the
|
Done in #87. |
This is a new type that matches to objects that are child of the given type.
This is useful for e.g. describing this case:
The
DiplomaticStance
is a non-abstract API object, and therefore is valid to be used on its own as a value for stance. As we only want to allow children, thechildren(DiplomaticStance)
matches to that.This implements preventing "too abstract" objects from being used.
The text was updated successfully, but these errors were encountered: