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

Invalid C code generated for lent array in tuple #24034

Closed
arnetheduck opened this issue Aug 30, 2024 · 0 comments · Fixed by #24035
Closed

Invalid C code generated for lent array in tuple #24034

arnetheduck opened this issue Aug 30, 2024 · 0 comments · Fixed by #24035
Assignees

Comments

@arnetheduck
Copy link
Contributor

Description

type T = object
  v: array[100, byte]


iterator pairs*(t: T): (int, lent array[100, byte]) =
  yield (0, t.v)


for a, b in default(T):
  echo a, " ", b

Nim Version

2.0.8

Current Output

nim c -r "testit.nim"
...CC: testit.nim
testit.nim: In function ‘NimMainModule’:
testit.nim:9:191: error: assignment to ‘NU8 *’ {aka ‘unsigned char *’} from incompatible pointer type ‘NU8 (*)[100]’ {aka ‘unsigned char (*)[100]’} [-Wincompatible-pointer-types]
    9 | for a, b in default(T):
      |                                                                                                                                                                                               ^
Error: execution of an external compiler program 'gcc ...'

Expected Output

No response

Known Workarounds

No response

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants