void (@NotNull PyStringLiteralExpression anchor, @NotNull PsiElement target, @NotNull String mappingKey) { final PyTypedElement typedElement = as(target, PyTypedElement.class); if (typedElement != null && myFormatSpec.containsKey(mappingKey)) { final PyType actual = myTypeEvalContext.getType(typedElement); final PyType expected = PyTypeParser.getTypeByName(anchor, myFormatSpec.get(mappingKey)); if (expected != null && actual != null && CHECKED_TYPES.contains(actual.getName()) && !PyTypeChecker.match(expected, actual, myTypeEvalContext)) { registerProblem(typedElement, PyPsiBundle.message("INSP.str.format.unexpected.argument.type", actual.getName())); } } }