---
title: "@dynamicCallable implementation requirements (DynamicCallable)"
framework: swift-compiler
role: article
role_heading: Article
path: swift-compiler/documentation/diagnostics/dynamic-callable-requirements
---

# @dynamicCallable implementation requirements (DynamicCallable)

## Overview

Overview If a type is marked with the @dynamicCallable attribute, it must provide a valid implementation of dynamicallyCall(withArguments:), dynamicallyCall(withKeywordArguments:), or both. If it fails to do so, an error will be reported at compile-time. Note that an implementation of dynamicallyCall(withKeywordArguments:) is required to support calls with keyword arguments. To be considered valid, an implementation of dynamicallyCall(withArguments:) must: Be an instance method. static or class implementations are not allowed. Have an argument type which conforms to the ExpressibleByArrayLiteral protocol. Often, this will be the built in Array type. The return type of dynamicallyCall(withArguments:) may be any valid type. To be considered valid, an implementation of dynamicallyCall(withKeywordArguments:) must: Be an instance method. static or class implementations are not allowed. Have an argument type which conforms to the ExpressibleByDictionaryLiteral protocol. This can be Dictionary, KeyValuePairs (which may be used to support duplicated keyword arguments), or some other conforming type. The Key associated type of the argument type must conform to the ExpressibleByStringLiteral protocol. This type is used to represent the dynamic argument keywords. The Value associated type of the argument type and the return type of dynamicallyCall(withKeywordArguments:) may be any valid types. See also SE-0216

## See Also

- [Add @preconcurrency import (AddPreconcurrencyImport)](swift-compiler/documentation/diagnostics/add-preconcurrency-import.md)
- [Always enabled availability domains (AlwaysAvailableDomain)](swift-compiler/documentation/diagnostics/always-available-domain.md)
- [Argument matching for trailing closures (TrailingClosureMatching)](swift-compiler/documentation/diagnostics/trailing-closure-matching.md)
- [Calling a mutating async actor-isolated method (ActorIsolatedMutatingAsync)](swift-compiler/documentation/diagnostics/actor-isolated-mutating-async.md)
- [Calling an actor-isolated method from a synchronous nonisolated context (ActorIsolatedCall)](swift-compiler/documentation/diagnostics/actor-isolated-call.md)
- [Captures in a `@Sendable` closure (SendableClosureCaptures)](swift-compiler/documentation/diagnostics/sendable-closure-captures.md)
- [Compilation caching (CompilationCaching)](swift-compiler/documentation/diagnostics/compilation-caching.md)
- [Conforming to `StringInterpolationProtocol` (StringInterpolationConformance)](swift-compiler/documentation/diagnostics/string-interpolation-conformance.md)
- [Conversion from `@isolated(any)` function type to synchronous function type (ConversionFromIsolatedAnyToSynchronous)](swift-compiler/documentation/diagnostics/conversion-from-isolated-any-to-synchronous.md)
- [Cross-isolation data race (RegionIsolationCrossIsolationDataRace)](swift-compiler/documentation/diagnostics/region-isolation-cross-isolation-data-race.md)
- [Deprecated declaration warnings (DeprecatedDeclaration)](swift-compiler/documentation/diagnostics/deprecated-declaration.md)
- [Deprecated implementation-only imports (ImplementationOnlyDeprecated)](swift-compiler/documentation/diagnostics/implementation-only-deprecated.md)
- [Dynamic exclusivity (DynamicExclusivity)](swift-compiler/documentation/diagnostics/dynamic-exclusivity.md)
- [Embedded Swift language restrictions (EmbeddedRestrictions)](swift-compiler/documentation/diagnostics/embedded-restrictions.md)
- [Existential Types and Performance (ExistentialType)](swift-compiler/documentation/diagnostics/existential-type.md)
