# Redeclaration of named tuple members

**URL:** <https://forums.swift.org/t/redeclaration-of-named-tuple-members/18756>\
**Category:** Using Swift\
**Tags:** tuple\
**Created:** [December 12, 2018, 8:57am UTC](https://forums.swift.org/t/redeclaration-of-named-tuple-members/18756 "2018-12-12T08:57:15Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![jrose](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jrose/32/408_2.png) [@jrose](https://forums.swift.org/u/jrose)\
**Post date:** [December 12, 2018, 4:32pm UTC](https://forums.swift.org/t/redeclaration-of-named-tuple-members/18756/21 "2018-12-12T16:32:36Z")

</div>

Tuple shuffling is about reordering labels without changing the overall set of labels. Adding or stripping the labels is a separate feature. Anything that messes with the labels that isn't one of those two operations is probably a bug caused by a bad interaction between the two features.

---

<div class="post-metadata">

**Author:** ![jrose](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jrose/32/408_2.png) [@jrose](https://forums.swift.org/u/jrose)\
**Post date:** [December 12, 2018, 4:34pm UTC](https://forums.swift.org/t/redeclaration-of-named-tuple-members/18756/22 "2018-12-12T16:34:23Z")

</div>

As far as the `as?` issue goes, the fix-it is wrong—please file a bug!—but the correct thing to write here is `as (Int, Int)?`. That is, you want to do a compile-time conversion to an Optional tuple value, as opposed to a run-time-checked conversion to a non-Optional value.

---

<div class="post-metadata">

**Author:** ![Jens](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jens/32/12903_2.png) [@Jens](https://forums.swift.org/u/Jens)\
**Post date:** [December 12, 2018, 6:13pm UTC](https://forums.swift.org/t/redeclaration-of-named-tuple-members/18756/23 "2018-12-12T18:13:28Z")

</div>

Btw, here is a way to get the behavior you ask for in the OP (for any tuple) at the cost of one extra character:

```swift
// Make a prefix operator that converts any labeled tuple to an unlabeled one:
prefix operator •
prefix func •<A, B>(rhs: (A, B)) -> (A, B) { return rhs }
prefix func •<A, B, C>(rhs: (A, B, C)) -> (A, B, C) { return rhs }
prefix func •<A, B, C, D>(rhs: (A, B, C, D)) -> (A, B, C, D) { return rhs }
// ... add more if needed ...

// Now you can do this:
func test() {
    let counter = 119
    let final: (min: Int, sec: Int) = •counter.quotientAndRemainder(dividingBy: 60)
    print(final) // (min: 1, sec: 59)
}
test()

```

[Previous page](https://forums.swift.org/t/redeclaration-of-named-tuple-members/18756.md?page=1)
