-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
slicing in collect
macro as add operation doesn't work
#18405
Comments
collect
macro doesn't workcollect
macro as collection's add operation doesn't work
collect
macro as collection's add operation doesn't workcollect
macro as add operation doesn't work
new investigation: import sugar
func makeSlice(slice: HSlice[int ,int]): auto =
slice
let a = 1..2
let ranges = collect newseq:
for i in 0..10:
# a # works [7]
# makeSlice 1 .. 2 # works [8]
1 .. 2 # doesn't work [9]
|
Output of collect looks ok: var collectResult_402653193 = initTable[typeof do:
for word in document:
2, typeof do:
for word in document:
word[0 .. 2]]()
for word in document:
collectResult_402653193[2] = word[0 .. 2]
collectResult_402653193 this |
Use |
I cannot fix it, I added
Actually everything breaks if you make it |
|
the compiler gives type mismatch error for slicing in
collect
macroExample
Current Output
compiler error for [4]
compiler error for [6]:
Expected Output
compiles successfully
Additional Information
maybe related to #12383
my environment:
The text was updated successfully, but these errors were encountered: