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

REPL element truncation should not silently truncate #12337

Open
som-snytt opened this issue Feb 10, 2021 · 3 comments
Open

REPL element truncation should not silently truncate #12337

som-snytt opened this issue Feb 10, 2021 · 3 comments

Comments

@som-snytt
Copy link

reproduction steps

using Scala 2.13.4,

scala -Dscala.repl.maxprintstring=10000
Welcome to Scala 2.13.4 (OpenJDK 64-Bit Server VM, Java 15).
Type in expressions for evaluation. Or try :help.

scala> Iterator.from(1).take(10000).to(List)
[snip] 998, 999, 1000)

problem

The truncated collection is rendered without an ellipsis.

Reported at scala/scala3#11377

@som-snytt
Copy link
Author

som-snytt commented Feb 13, 2021

Added to the PR for REPL printing tweaks. Disappointed that PR isn't in the next milestone.

scala> Iterator.from(1).take(10000).to(List)
val res0: List[Int] = List(1, 2, 3, [snip -Ed] 139, 140, 141, ...)

scala> def vs = Iterator.from(1).take(10000)
def vs: Iterator[Int]

scala> List(vs,vs)
val res0: List[Iterator[Int]] = List(<iterator>, <iterator>)

scala> .map(_.toList)
val res1: List[List[Int]] = List(List(1, 2, 3, [snip -Ed] 139, 140, 141, ...), ...)

scala>

@bjornregnell
Copy link

@som-snytt The linked PR is covering more ground... Would a limited fix that just don't truncate silently have a bigger chance to be accepted, as the runtime behavior change is much more limited?

@SethTisue
Copy link
Member

@som-snytt seconding Bjorn, can we interest you in submitting this fix as an independent PR? not there's no hope for the rest of #8885 (Dale and I are going through that right now), but regardless, afaics this part really ought to be its own PR

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

Successfully merging a pull request may close this issue.

3 participants