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

sum with refinement types #496

Open
mtshiba opened this issue Mar 21, 2024 · 0 comments
Open

sum with refinement types #496

mtshiba opened this issue Mar 21, 2024 · 0 comments
Labels
bug Something isn't working bug-inference Type inference bugs

Comments

@mtshiba
Copy link
Member

mtshiba commented Mar 21, 2024

Describe the bug?

If you substitute an expression with a dependent type to the argument of sum, the return type will be wrong.

Reproducible code

s: {2, 1} = sum [1, 2]

Expected result

TypeError: sum([1, 2]): Nat (or {3})

Actual result

passed

Additional context

Here is the type definition of sum:

|A <: Add(A)| (iterable: Iterable(A), start: A or Int := Int) -> A

Erg version

0.6.32

Python version

None

OS

None

@mtshiba mtshiba added bug Something isn't working bug-inference Type inference bugs labels Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bug-inference Type inference bugs
Projects
None yet
Development

No branches or pull requests

1 participant