You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if it's due to the way [] is hardcoded in compiler in a few places eg:
semArrGet:
x[0] =newIdentNode(getIdent(c.cache, "[]"), n.info)
of nkCallKinds:
# builtin slice keeps lvalue-ness:ifgetMagic(n) in {mArrGet, mSlice}:
result=isAssignable(owner, n[1], isUnsafeAddr)
procmatches*(c: PContext, n, nOrig: PNode, m: varTCandidate) =if m.magic in {mArrGet, mArrPut}:
elif op.name.s =="[]"and op.fromSystem:
let slice = n[2].skipStmtList
c.addSlice(n, n[1], slice[1], slice[2])
analyseSons(c, n)
elif op.name.s =="[]="and op.fromSystem:
let slice = n[2].skipStmtList
c.addSlice(n, n[1], slice[1], slice[2])
analyseSons(c, n)
if ident !=niland ident.s =="[]":
The text was updated successfully, but these errors were encountered:
timotheecour
changed the title
typeof(a[0]) in proc return type gives: Error: type mismatch
typeof(a[0]) in generic proc return type gives: Error: type mismatch
Jul 2, 2020
typeof(a[0]) in proc return type gives: Error: type mismatch
Example
Current Output
Expected Output
Additional Information
05384ef 1.3.5 devel
note
I'm wondering if it's due to the way
[]
is hardcoded in compiler in a few places eg:The text was updated successfully, but these errors were encountered: