<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntentsTesting",
  "identifier" : "/documentation/AppIntentsTesting/ResolvedIntentResult/subscript(dynamicMember:)-kbqk",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "App Intents Testing"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting20ResolvedIntentResultV13dynamicMemberxs7KeyPathCyAC05ValueiJ0Vs5NeverOG_tc0aB11TypeSupport0eK11ConvertibleRzluip"
  },
  "title" : "subscript(dynamicMember:)"
}
-->

# subscript(dynamicMember:)

Returns the intent’s output, converted to the inferred type.

```
subscript<T>(dynamicMember keyPath: KeyPath<ResolvedIntentResult.ValueKeyPath, Never>) -> T where T : IntentValueConvertible { get throws }
```

## Overview

Access the return value using the `value` key path, for example:

```swift
let result = try await intent.run()

// Compare the result with a concrete value.
XCTAssertEqual(try result.value, "Hello World")
```

If the property’s value isn’t an instance of the type `T`,
this subscript throws an error.

For more information about dynamic-member syntax,
see [dynamicMemberLookup](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes#dynamicMemberLookup) in *[The Swift Programming Language](https://docs.swift.org/swift-book/)*.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)