⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@xuwei-k
Copy link
Contributor

@xuwei-k xuwei-k commented Jan 7, 2026

Welcome to Scala 3.7.4 (21.0.9, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                                            
scala> scala.collection.immutable.SortedMap(1 -> 2)(implicitly[Ordering[Int]])
1 warning found
-- Warning: --------------------------------------------------------------------
1 |scala.collection.immutable.SortedMap(1 -> 2)(implicitly[Ordering[Int]])
  |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^
  |Implicit parameters should be provided with a `using` clause.
  |To disable the warning, please use the following option:
  |  "-Wconf:msg=Implicit parameters should be provided with a `using` clause:s"
val res0: scala.collection.immutable.SortedMap[Int, Int] = TreeMap(1 -> 2)
Welcome to Scala 3.8.0-RC5 (21.0.9, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                                            
scala> scala.collection.immutable.SortedMap(1 -> 2)(implicitly[Ordering[Int]])
-- [E007] Type Mismatch Error: -------------------------------------------------
1 |scala.collection.immutable.SortedMap(1 -> 2)(implicitly[Ordering[Int]])
  |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^
  |                                             Found:    Ordering[Int]
  |                                             Required: Int
  |
  | longer explanation available when compiling with `-explain`
1 error found
                                                                                                                                            
scala> scala.collection.immutable.SortedMap(1 -> 2)(using implicitly[Ordering[Int]])
val res0: scala.collection.immutable.SortedMap[Int, Int] = TreeMap(1 -> 2)

Copy link
Contributor

@satorg satorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, totally makes sense even without Scala 3.8 compatibility concern.
Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants