Check for object type fails with "is not a type" error
<p>I'm trying to check if an object is of a given type and I'm getting an error:</p>

<blockquote>
  <p>'expectedClass' is not a type</p>
</blockquote>

<p><a href="https://i.stack.imgur.com/kwcTO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kwcTO.png" alt="xcode"></a></p>

<p>My code below.</p>

<pre><code>func testInputValue(inputValue: AnyObject, isKindOfClass expectedClass: AnyClass) throws {
    guard let object = inputValue as? expectedClass else {
        // Throw an error
        let userInfo = [NSLocalizedDescriptionKey: "Expected an inputValue of type \(expectedClass), but got a \(inputValue.dynamicType)"]
        throw NSError(domain: RKValueTransformersErrorDomain, code: Int(RKValueTransformationError.UntransformableInputValue.rawValue), userInfo: userInfo)
    }
}
</code></pre>

<p>I'm trying to figure out what can be wrong here.</p>