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

Reassigning Strings with new does not work #291

Open
wegendt-bosch opened this issue Feb 22, 2019 · 0 comments
Open

Reassigning Strings with new does not work #291

wegendt-bosch opened this issue Feb 22, 2019 · 0 comments
Labels
Bug Something isn't working Prio.Medium

Comments

@wegendt-bosch
Copy link
Contributor

Current behavior:
Reinitializing strings does not work.

Expected behavior:
Reassigning a variable with new string(100) should empty the string.

Related code:

every 100 milliseconds {
	var s = new string(100);
	s += "a";
	s = new string(100);
	s += "b";
}

produces

	char s_buf[103] = {0};
	char *s = s_buf;
	
	
	char mainHandleEvery100Millisecond12S_2_buf[] = "a";
	strcat(s, mainHandleEvery100Millisecond12S_2_buf);
	; // here the reinitialization should happen
	char mainHandleEvery100Millisecond12S_5_buf[] = "b";
	strcat(s, mainHandleEvery100Millisecond12S_5_buf);

Other information:
Might be fixed by the new type system

@wegendt-bosch wegendt-bosch added Bug Something isn't working Prio.Medium labels Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Prio.Medium
Projects
None yet
Development

No branches or pull requests

1 participant