-
Couldn't load subscription status.
- Fork 153
Open
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
The main.k:
schema Fold:
l: [any]
acc: any
func: (any, any) -> any
value: any = acc if len(l) == 0 else Fold {
# `l` has been replaced by `l[1::]`. When the size of `l` is 1, the next line should raise an error
l: l[1::]
# the `l` has been replaced in the previous line, when the size of `l` is 1, error here !
acc: func(acc, l[0])
func: func
}.value
flod = Fold {
l: [1, 2, 3, 4, 5],
acc: 0,
func: lambda x, y { x + y }
}.value2. What did you expect to see? (Required)
An error raised.
3. What did you see instead (Required)
No errors, and an result got:
flod: 15
4. What is your KCL components version? (Required)
The main branch of KCL
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
No status