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

+= isn't working for strings #5383

Closed
tsuf239 opened this issue Jan 1, 2024 · 4 comments
Closed

+= isn't working for strings #5383

tsuf239 opened this issue Jan 1, 2024 · 4 comments
Assignees
Labels
🐛 bug Something isn't working 🐶 dogfood Discovered while dogfooding Winglang good first issue Good for newcomers

Comments

@tsuf239
Copy link
Collaborator

tsuf239 commented Jan 1, 2024

I tried this:

let var message = "Yay! another user registered to the raffle!\n";
message  += "*email:* {email} *name:* {name}\n";

This happened:

image

I expected this:

to just work :)

Is there a workaround?

message = message + "*email:* {email} *name:* {name}\n";

Anything else?

Discovered while working on this project: https://github.com/winglang/wing-raffle

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@tsuf239 tsuf239 added the 🐛 bug Something isn't working label Jan 1, 2024
@tsuf239 tsuf239 changed the title += isn't working for strings (wingly raffle conclusion) += isn't working for strings (wingly raffle conclusion) Jan 1, 2024
@staycoolcall911 staycoolcall911 added 🐶 dogfood Discovered while dogfooding Winglang good first issue Good for newcomers labels Jan 1, 2024
@tsuf239 tsuf239 changed the title += isn't working for strings (wingly raffle conclusion) += isn't working for strings Jan 1, 2024
@lausuarez02
Copy link
Contributor

Hey i would like to take this one but, where exactly should i tackled this issue? folder/architecture wise

@staycoolcall911
Copy link
Contributor

staycoolcall911 commented Jan 4, 2024

You got it @lausuarez02 :)
Here's how Chris added string concat with + a while ago: #2429
It should give you a hint how to start.
You should have some relevant guides on our doc site, such as this one: https://www.winglang.io/contributing/start-here/development#how-do-i-make-changes-to-the-wing-grammar
We're here (and in Slack) for questions - buen viaje!

@lausuarez02 lausuarez02 removed their assignment Jan 9, 2024
@Warkanlock Warkanlock assigned Warkanlock and unassigned Warkanlock Jan 17, 2024
@Warkanlock
Copy link
Collaborator

Warkanlock commented Jan 17, 2024

@lausuarez02 are you going to take this one? Maybe I can do it during my weekend, but if you take this one, I can take others from the backlog

@revitalbarletz
Copy link
Collaborator

@Warkanlock its all yours :)

mergify bot pushed a commit that referenced this issue Jan 18, 2024
)

Related to #5383

## Description

Based on #5383 request, we wanted to add the `+=` operator support to `string` types, so we are now able to achieve the following and compile `.wing` files correctly

```rust
let var initial = "hey";
initial += "you!";
```

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🐶 dogfood Discovered while dogfooding Winglang good first issue Good for newcomers
Projects
Archived in project
Development

No branches or pull requests

5 participants