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

The types for Set and Map are noisy in REPL #12849

Open
som-snytt opened this issue Aug 23, 2023 · 1 comment
Open

The types for Set and Map are noisy in REPL #12849

som-snytt opened this issue Aug 23, 2023 · 1 comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
Milestone

Comments

@som-snytt
Copy link

Reproduction steps

Scala version: 2.13.11

Welcome to Scala 2.13.11 (OpenJDK 64-Bit Server VM, Java 20.0.1).
Type in expressions for evaluation. Or try :help.

scala> Seq(42)
val res0: Seq[Int] = List(42)

scala> Set(42)
val res1: scala.collection.immutable.Set[Int] = Set(42)

scala> Map("a"->42)
val res2: scala.collection.immutable.Map[String,Int] = Map(a -> 42)

Problem

The types for Set and Map aliased in Predef instead of scala.package are noisy.

It makes it look like I accidentally summoned a type which is not the "default".

This issue is possibly different from "display shortest name given my imports".

@SethTisue
Copy link
Member

SethTisue commented Aug 23, 2023

reminds me of the business about whether to show Object or AnyRef. we would prefer the latter, but often we end up showing the former.

It makes it look like I accidentally summoned a type which is not the "default"

That's one way of looking at it, but it's also possible to think of it as the compiler helpfully showing you what the shortcut you used actually points to.

This issue is possibly different from "display shortest name given my imports".

Yeah, I'd say those are distinct. One's about imports, one's about aliases.

@SethTisue SethTisue added this to the Backlog milestone Jan 26, 2024
@SethTisue SethTisue added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
Projects
None yet
Development

No branches or pull requests

2 participants