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

unable to concat strings in for loop "operator += not defined on left operand type string" #21234

Closed
ttytm opened this issue Apr 9, 2024 · 0 comments · Fixed by #21237
Closed
Assignees
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@ttytm
Copy link
Member

ttytm commented Apr 9, 2024

Describe the bug

mut arr := ['a', 'b', 'c']
for mut c in arr {
	c += 'd'
}

Reproduction Steps

above

Expected Behavior

Working code. Same as arr[i] += 'str'

Current Behavior

error: operator `+=` not defined on left operand type `string`
    1 | mut arr := ['a', 'b', 'c']
    2 | for mut c in arr {
    3 |     c += 'd'
      |     ^
    4 | }

Possible Solution

No response

Additional Information/Context

No response

V version

v0.4.5

Environment details (OS name and version, etc.)

Linux x64

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@ttytm ttytm added the Bug This tag is applied to issues which reports bugs. label Apr 9, 2024
@Delta456 Delta456 self-assigned this Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants