We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0387869 commit f9d65f8Copy full SHA for f9d65f8
library/src/scala/NamedTuple.scala
@@ -214,10 +214,8 @@ object NamedTupleDecomposition:
214
* Keys are the names of the elements.
215
*/
216
inline def toMap: collection.immutable.Map[String, Tuple.Union[V]] =
217
- summonAll[Tuple.Map[N, ValueOf]].toList
218
- .map(_.asInstanceOf[ValueOf[? <: String]].value)
219
- .lazyZip(x.toList)
220
- .toMap
+ inline compiletime.constValueTuple[N].toList match
+ case names: List[String] => names.lazyZip(x.toList).toMap
221
end extension
222
223
/** The names of a named tuple, represented as a tuple of literal string values. */
0 commit comments