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

SeqView.addString returns "...". #5656

Closed
scabug opened this Issue Apr 11, 2012 · 7 comments

Comments

Projects
None yet
2 participants
@scabug
Copy link

scabug commented Apr 11, 2012

println(Seq(Array('1','2','3'), Array('a','b','c')).view.addString(new StringBuilder, "_"))

I expect it print "123_abc", but I got "...".

@scabug

This comment has been minimized.

Copy link

scabug commented Apr 11, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5656?orig=1
Reporter: @Atry
Affected Versions: 2.9.1, 2.10.0-M2

@scabug

This comment has been minimized.

Copy link

scabug commented Apr 11, 2012

@paulp said:
Surely it is apparent this behavior does not arise by accident. If you want the contents, force the view. (It still won't print 123_abc because it contains arrays, but that's not a bug either.)

@scabug

This comment has been minimized.

Copy link

scabug commented Apr 11, 2012

@Atry said:
Only "transformer methods" have diffent behaviors, and addString is not a transformer method. "addString" should works as usual. See http://www.scala-lang.org/docu/files/collections-api/collections_42.html

@scabug

This comment has been minimized.

Copy link

scabug commented Apr 12, 2012

@paulp said:
OK, since I don't whether that is true, reopening and assigning to reviewer.

@scabug

This comment has been minimized.

Copy link

scabug commented May 3, 2012

@hubertp said:
Alex can you decide what is the correct behaviour, please?

@scabug

This comment has been minimized.

Copy link

scabug commented May 4, 2012

@axel22 said:
I'm unsure why addString was overridden in ViewMkString to add ....
It does not seem consistent with the fact that mkString does force the view contents.

I would say that addString should force the view, just like mkString.

@scabug

This comment has been minimized.

Copy link

scabug commented May 4, 2012

@axel22 said:
And I can't seem to find any place where forcing behaviour for addString would break existing code.

@scabug scabug closed this May 4, 2012

@scabug scabug added the minimized label Apr 7, 2017

@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment