Skip to content

Commit c45727d

Browse files
committed
review fixes
1 parent 7a11950 commit c45727d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

library/src/scala/NamedTuple.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package scala
22
import compiletime.ops.boolean.*
33
import compiletime.summonAll
4-
import collection.immutable.ListMap
4+
import collection.immutable.{SeqMap, ListMap}
55

66
import language.experimental.captureChecking
77

@@ -32,7 +32,7 @@ object NamedTuple:
3232
import NamedTupleDecomposition.{Names, DropNames}
3333
export NamedTupleDecomposition.{
3434
Names, DropNames,
35-
apply, size, init, head, last, tail, take, drop, splitAt, ++, map, reverse, zip, toList, toArray, toIArray, toListMap
35+
apply, size, init, head, last, tail, take, drop, splitAt, ++, map, reverse, zip, toList, toArray, toIArray, toSeqMap
3636
}
3737

3838
extension [N <: Tuple, V <: Tuple](x: NamedTuple[N, V])
@@ -214,7 +214,7 @@ object NamedTupleDecomposition:
214214
/** An immutable map consisting of all element values preserving an order of fields.
215215
* Keys are the names of the elements.
216216
*/
217-
inline def toListMap: ListMap[String, Tuple.Union[V]] =
217+
inline def toSeqMap: SeqMap[String, Tuple.Union[V]] =
218218
inline compiletime.constValueTuple[N].toList match
219219
case names: List[String] =>
220220
ListMap.from(names.iterator.zip(

tests/run/named-tuple-ops.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ type Labels = (x: String, y: String)
8686
val cityArr = city.toArray
8787
assert(cityArr.sameElements(Array("Lausanne", 1000, 140000)))
8888

89-
val cityMap = city.toListMap
90-
val _: ListMap[String, String | Int] = cityMap
89+
val cityMap = city.toSeqMap
90+
val _: SeqMap[String, String | Int] = cityMap
9191
assert(cityMap == ListMap("name" -> "Lausanne", "zip" -> 1000, "pop" -> 140000))

0 commit comments

Comments
 (0)