---
title: "DecodingError.typeMismatch(_:_:)"
framework: swift
role: symbol
role_heading: Case
path: "swift/decodingerror/typemismatch(_:_:)"
---

# DecodingError.typeMismatch(_:_:)

An indication that a value of the given type could not be decoded because it did not match the type of what was found in the encoded payload.

## Declaration

```swift
case typeMismatch(any Any.Type, DecodingError.Context)
```

## Discussion

Discussion As associated values, this case contains the attempted type and context for debugging.
