From e85bd99c9c11493a4651cc8e435951593960a572 Mon Sep 17 00:00:00 2001 From: odersky Date: Sat, 23 Nov 2024 13:35:41 +0100 Subject: [PATCH] Drop reference to implicit conversion from named to regular tuples The NamedTuple spec mentioned that `.toTuple` was inserted implicitly to convert from a named to a regular tuple. But this was not implemented. The sentiment is that this presents an opportunity to get more experience with the feature before deciding whether the conversion is actually beneficial. For now, one can implement the conversion by hand if desired, like this: ```scala given [N <: Tuple, V <: Tuple] => Conversion[NamedTuple.NamedTuple[N, V], V] = _.toTuple ``` --- docs/_docs/reference/other-new-features/named-tuples.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/_docs/reference/other-new-features/named-tuples.md b/docs/_docs/reference/other-new-features/named-tuples.md index 5483c5cc255b..8b26d62e8ac6 100644 --- a/docs/_docs/reference/other-new-features/named-tuples.md +++ b/docs/_docs/reference/other-new-features/named-tuples.md @@ -43,7 +43,7 @@ val x: (String, Int) = Bob.toTuple // ok ``` `toTuple` is defined as an extension method in the `NamedTuple` object. It returns the given tuple unchanged and simply "forgets" the names. - + Note that conformance rules for named tuples are analogous to the rules for named parameters. One can assign parameters by position to a named parameter list. ```scala def f(param: Int) = ...