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 Singleton type #266

Open
Roger-luo opened this issue Feb 18, 2025 · 0 comments
Open

support Singleton type #266

Roger-luo opened this issue Feb 18, 2025 · 0 comments
Labels
bug Something isn't working dialect: python types issues related to builtin dialect py.types

Comments

@Roger-luo
Copy link
Member

right now when we write

@basic(typeinfer=True)
def main(x):
    x = x + 1

the return type will be types.Literal(None) which is due to https://github.com/QuEraComputing/kirin/blob/main/src/kirin/dialects/func/typeinfer.py#L28 and the real reason we have this is because our type system does not understand singletons

@Roger-luo Roger-luo added bug Something isn't working dialect: python types issues related to builtin dialect py.types labels Feb 18, 2025
Roger-luo added a commit that referenced this issue Feb 19, 2025
I think we should just special case `None` for now before actually
supporting enums and singletons (#266)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dialect: python types issues related to builtin dialect py.types
Projects
None yet
Development

No branches or pull requests

1 participant