diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py
--- a/mypy/checkexpr.py
+++ b/mypy/checkexpr.py
@@ -3918,6 +3918,12 @@ def visit_assert_type_expr(self, expr: AssertTypeExpr) -> Type:
             always_allow_any=True,
         )
         target_type = expr.type
+        proper_source_type = get_proper_type(source_type)
+        if (
+            isinstance(proper_source_type, mypy.types.Instance)
+            and proper_source_type.last_known_value is not None
+        ):
+            source_type = proper_source_type.last_known_value
         if not is_same_type(source_type, target_type):
             if not self.chk.in_checked_function():
                 self.msg.note(

diff --git a/test-data/unit/check-expressions.test b/test-data/unit/check-expressions.test
--- a/test-data/unit/check-expressions.test
+++ b/test-data/unit/check-expressions.test
@@ -937,6 +937,8 @@ reveal_type(returned)  # N: Revealed type is "builtins.int"
 assert_type(a, str)  # E: Expression is of type "int", not "str"
 assert_type(a, Any)  # E: Expression is of type "int", not "Any"
 assert_type(a, Literal[1])  # E: Expression is of type "int", not "Literal[1]"
+assert_type(42, Literal[42])
+assert_type(42, int)  # E: Expression is of type "Literal[42]", not "int"
 [builtins fixtures/tuple.pyi]
 
 [case testAssertTypeGeneric]

`assert_type()` says an int is not an int
The following code:

```python
from typing_extensions import assert_type

assert_type(42, int)
```

fails to typecheck with the following message:

```
assert-type01.py:3: error: Expression is of type "int", not "int"
```

**Your Environment**

- Mypy version used: both 0.960 and commit 1636a0549670e1b75e2987c16ef26ebf91dfbde9
- Mypy command-line flags: none
- Mypy configuration options from `mypy.ini` (and other config files): none
- Python version used: 3.9.13
- Operating system and version: macOS 11.6.6

Lol, it's probably `Literal[42]`. So bad error message, but there should probably still be an error? Jelle will confirm.
Yeah, pyright also gives an error `error: "assert_type" mismatch: expected "int" but received "Literal[42]"`
Implementation hints: 42 has type `Instance` with the `last_known_value` attribute set to the literal type. If the string representations of types in the assert_type error are the same, we can perhaps try again while using `last_known_value` if it exists.
Looks like I self-assigned this but then forgot about it. I'm happy to leave this to a sprint contributor.

As the author of assert_type(), I think it's reasonable for a type checker to fail on `assert_type(42, int)` if it infers 42 to be of type `Literal[42]`. `assert_type()` is meant to check that the types are exactly the same.

mypy's current behavior is actually different from what this issue reports:

```
from typing_extensions import assert_type, Literal

assert_type(42, int)  # passes
assert_type(42, Literal[42]) # also passes
```

I think this behavior is wrong: exactly one of these two should succeed, but not both. Which of the two is up to the type checker to decide. For both pyanalyze and pyright, `42` is inferred as type `Literal[42]` and therefore the first `assert_type` fails. Mypy could choose to instead infer `42` as being of type `int`, which would make the second assert fail instead.
mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoneAsRvalue mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNonBooleanOr mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testChainedCompResTyp mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testMatMul mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testIs mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoneAsArgument mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testInOperator mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDiv mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNotInOperator mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testIntLiteral mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testIsNot mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testIntDiv mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrLiteral mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNonBooleanContainsReturnValue mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testIsRightOperand mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testInWithInvalidArgs mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testReverseBinaryOperator mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testMod mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testFloatLiteral mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testEq mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testReverseBinaryOperator2 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testLtAndGt mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testPow mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testReverseBinaryOperator3 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testComplexLiteral mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::cmpIgnoredPy3 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testBinaryOperatorWithAnyRightOperand mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testMiscBinaryOperators mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testLeAndGe mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testBytesLiteral mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testReverseComparisonOperator mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testBooleanAndOr mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testChainedComp mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testReversibleComparisonWithExtraArgument mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUnicodeLiteralInPython3 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRestrictedTypeAnd mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testChainedCompBoolRes mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testErrorContextAndBinaryOperators mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAdd mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRestrictedTypeOr mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testErrorContextAndBinaryOperators2 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testCastExpressions mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAndOr mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSub mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRestrictedBoolAndOrWithGenerics mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDivmod mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAnyCast mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testMul mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoneSliceBoundsWithStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUnaryMinus mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoneReturnTypeWithExpressions mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testTrivialLambda mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoneReturnTypeWithExpressions2 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUnaryPlus mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testVoidLambda mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testGetSlice mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUnaryNot mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAssertTypeGeneric mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoCrashOnLambdaGenerator mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSlicingWithInvalidBase mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUnaryBitwiseNeg mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSlicingWithNonindexable mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testLambdaAndReachability mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNonIntSliceBounds mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAssertTypeUncheckedFunction mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSimpleListComprehension mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testIndexing mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSliceSupportsIndex mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSimpleListComprehensionNestedTuples mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoneSliceBounds mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAssertTypeUncheckedFunctionWithUntypedCheck mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testIndexingAsLvalue mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSimpleListComprehensionNestedTuples2 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testConditionalExpressionUnionWithAny mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSimpleGeneratorExpression mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAssertTypeNoPromoteUnion mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testOverloadedIndexing mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testConditionalExpressionStatementNoReturn mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testGeneratorIncompatibleErrorMessage mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoneReturnTypeBasics mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testListComprehensionWithNonDirectMapping mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testOperationsWithNonInstanceTypes mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSimpleConditionalExpression mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testNoneReturnTypeWithStatements mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testErrorInListComprehensionCondition mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testOperatorMethodWithInvalidArgCount mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testConditionalExpressionWithEmptyCondition mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testTypeInferenceOfListComprehension mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testIndexedLvalueWithSubtypes mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testOperatorMethodAsVar mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testConditionalExpressionWithSubtyping mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSimpleListComprehensionInClassBody mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testOperatorMethodAsVar2 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testConditionalExpressionAndTypeContext mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testEllipsis mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSimpleSetComprehension mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testConditionalExpressionUnion mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testYieldExpression mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testYieldFromTupleExpression mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSimpleDictionaryComprehension mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictFromIterableAndKeywordArg3 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictWithKeywordArgsOnly mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testYieldExpressionWithNone mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testYieldFromIteratorHasNoValue mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictWithoutKeywordArgs mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictionaryComprehensionWithNonDirectMapping mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictFromIterableAndStarStarArgs mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testYieldFromGeneratorHasValue mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUserDefinedRevealType mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSpecialSignatureForSubclassOfDict2 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictFromList mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictFromIterableAndStarStarArgs2 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testTypingRevealType mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUserDefinedClassNamedDict mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testOverridingSpecialSignatureInSubclassOfDict mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictFromIterableAndKeywordArg mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRevealType mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictFromIterableAndKeywordArg2 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testTypingExtensionsRevealType mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testSpecialSignatureForSubclassOfDict mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRevealLocals mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRevealUncheckedFunction mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRevealTypeVar mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testLambdaUnypedContext mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUndefinedRevealType mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRevealCheckUntypedDefs mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictWithStarExpr mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRevealForward mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testLambdaCheckUnypedContext mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testRevealTypedDef mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testEqNone mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictIncompatibleValueVerbosity mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictWithStarStarExpr mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testLambdaTypedContext mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testTypeAnnotationNeededMultipleAssignment mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testLtNone mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictIncompatibleTypeErrorMessage mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityEq mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityContains mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityBytesSpecialUnion mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityIs mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testDictIncompatibleKeyVerbosity mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityNoStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityByteArraySpecial mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityUnions mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityEqNoOptionalOverlap mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityBytesSpecial mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityOkPromote mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testCustomEqCheckStrictEquality mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityNoPromotePy3 mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualitySequenceAndCustomEq mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testCustomEqCheckStrictEqualityTuple mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testCustomEqCheckStrictEqualityOKInstance mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testCustomEqCheckStrictEqualityMeta mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityAny mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testCustomEqCheckStrictEqualityOKUnion mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testCustomContainsCheckStrictEquality mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testEmptyListOverlap mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testCustomEqVarStrictEquality mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityTypeVsCallable mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityMetaclass mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityWithALiteralNewType mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testCustomEqDecoratedStrictEquality mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityWithALiteral mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityDisabledWithTypeVarRestrictions mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testOverlappingClassCallables mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityAndEnumWithCustomEq mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUnimportedHintAny mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testOverlappingAnyTypeWithoutStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityWithFixedLengthTupleInCheck mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUnimportedHintOptional mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAssertionLazilyWithIsNone mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testUnimportedHintAnyLower mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAssertCurrentFrameIsNotUnreachable mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAssertionLazilyWithIsInstance mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testStrictEqualityWithBytesContains mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testTypeVarAsValue
mypy/test/testcheck.py::TypeCheckSuite::check-expressions.test::testAssertType