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

Promote inner enumerations #383

Closed
tefra opened this issue Jan 11, 2021 · 0 comments
Closed

Promote inner enumerations #383

tefra opened this issue Jan 11, 2021 · 0 comments

Comments

@tefra
Copy link
Owner

tefra commented Jan 11, 2021

Enumeration members cannot be forward referenced when its needed, eg fields default values.

@dataclass
class Roor:
    value: field(default=Predefined.VALUE)

    class Predefined(Enum)
        VALUE = "abc"

For that scenario only the generator is promoting the inner enum to root class. This split flow is creating issues than have to be dealt twice early in the analyzer handlers and in the sanitizer. Another side effect is the creation of duplicate enums with the exact same members.

A good solution would be to promote all inner enum classes to root early on. This could also make working with models a bit easier as well.

@tefra tefra closed this as completed in 8f2ee33 Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant