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

support types that are defined with values #790

Open
KotlinIsland opened this issue Oct 31, 2024 · 0 comments
Open

support types that are defined with values #790

KotlinIsland opened this issue Oct 31, 2024 · 0 comments

Comments

@KotlinIsland
Copy link
Owner

KotlinIsland commented Oct 31, 2024

a: Final = 1
A = Literal[a]
# okay, because `a` is always 1

b: a = a
# okay, because `a` is always 1

class C ...
c: Final = C()
d: c = c  # error
# bad because it's ambigious if the `c` here means instance `C` or `type[C]`, need to use `TypeOf[c]`

use case

@global_enum
class _A(Enum):
    A = 1
A: Final = _A.A

a: _A.A = A  # works
a: A = A  # desired
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