Skip to content

REPL: output lines order doesn't match input definitions order #8677

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

Closed
unkarjedy opened this issue Apr 6, 2020 · 3 comments · Fixed by #9005
Closed

REPL: output lines order doesn't match input definitions order #8677

unkarjedy opened this issue Apr 6, 2020 · 3 comments · Fixed by #9005

Comments

@unkarjedy
Copy link
Contributor

Minimized code

  1. open dotty REPL e.g. in dotty-example-project via sbt console
  2. paste following multiline content
sealed trait T1
case class X() extends T1
case class Y() extends T1
case object O extends T1

Output

// defined case class Y
// defined case object O
// defined trait T1
// defined case class X

Expectation

// defined trait T1
// defined case class X
// defined case class Y
// defined case object O

image

@unkarjedy
Copy link
Contributor Author

@unkarjedy unkarjedy changed the title repl output lines order doesn't match input definitions order REPL: output lines order doesn't match input definitions order Apr 6, 2020
@odersky
Copy link
Contributor

odersky commented Apr 6, 2020

Is there a requirement that the order matches?

@unkarjedy
Copy link
Contributor Author

Hm, actually I'm not aware of such requirement in any specification.
(neither I am aware of any requirement to provide some meaningful output at all 😊)
That's just a thing that used to work in Scala 2 (11, 12, 13).
In Scala Plugin Worksheets we use Scala / Dotty REPL under the hood, and with the current Dotty REPL implementation the output looks quite weird:

image
Some more details: https://youtrack.jetbrains.com/issue/SCL-17300#focus=streamItem-27-4064653.0-0
It's not something critical, just visually unsatisfying.

If a "feature"/"task" or any other tag is more appropriate here, please feel free to change it.

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.

4 participants