Open mtshiba opened 3 months ago
If you substitute an expression with a dependent type to the argument of sum, the return type will be wrong.
sum
s: {2, 1} = sum [1, 2]
TypeError: sum([1, 2]): Nat (or {3})
sum([1, 2]): Nat (or {3})
passed
Here is the type definition of sum:
|A <: Add(A)| (iterable: Iterable(A), start: A or Int := Int) -> A
0.6.32
None
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
Expected result
TypeError:
sum([1, 2]): Nat (or {3})
Actual result
passed
Additional context
Here is the type definition of
sum
:Erg version
0.6.32
Python version
None
OS
None