# Closure property that throws Typed Error in Swift 6 result in compiling error

**URL:** <https://forums.swift.org/t/closure-property-that-throws-typed-error-in-swift-6-result-in-compiling-error/72433>\
**Category:** Using Swift\
**Tags:** bug, throw, error, swift6\
**Created:** [June 13, 2024, 1:24am UTC](https://forums.swift.org/t/closure-property-that-throws-typed-error-in-swift-6-result-in-compiling-error/72433 "2024-06-13T01:24:04Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Quedlinbug](https://avatars.discourse-cdn.com/v4/letter/q/77aa72/32.png) [@Quedlinbug](https://forums.swift.org/u/Quedlinbug)\
**Post date:** [June 13, 2024, 6:44am UTC](https://forums.swift.org/t/closure-property-that-throws-typed-error-in-swift-6-result-in-compiling-error/72433/3 "2024-06-13T06:44:38Z")

</div>

There are problems with implicit typing. The Swift 6 Language Mode does not help. But so far, I've found that you can get around them with explicitness.

> [@The next paragraph of the proposal](#):
>
> Note that one can explicitly specify the thrown error type of a closure to disable this type inference, which has the nice effect of also providing a contextual type for throw statements:
> 
> ```swift
> { () throws(CatError) in
> if Int.random(in: 0..<24) < 20 {
> throw .asleep
> }
> }
> 
> ```

```swift
let example = Example { () throws(TypedError) in throw .failed }

```

> [@Where is FullTypedThrows?](https://forums.swift.org/t/where-is-fulltypedthrows/72346):
>
> Typed throws is finally here with Swift 6 in Xcode 16b1. However, it isn't very useful since you can't actually catch any typed errors without the FullTypedThrows experimental feature or Swift 6 mode. However, I can't seem to activate that part of the feature. Neither the experimental flag nor the full Swift 6 mode seem to enable the behavior. Was it removed?

---

_[View the full topic](https://forums.swift.org/t/closure-property-that-throws-typed-error-in-swift-6-result-in-compiling-error/72433)._
