diff --git a/mypy/constraints.py b/mypy/constraints.py
--- a/mypy/constraints.py
+++ b/mypy/constraints.py
@@ -420,8 +420,12 @@ def filter_satisfiable(option: list[Constraint] | None) -> list[Constraint] | No
         return option
     satisfiable = []
     for c in option:
-        # TODO: add similar logic for TypeVar values (also in various other places)?
-        if mypy.subtypes.is_subtype(c.target, c.origin_type_var.upper_bound):
+        if isinstance(c.origin_type_var, TypeVarType) and c.origin_type_var.values:
+            if any(
+                mypy.subtypes.is_subtype(c.target, value) for value in c.origin_type_var.values
+            ):
+                satisfiable.append(c)
+        elif mypy.subtypes.is_subtype(c.target, c.origin_type_var.upper_bound):
             satisfiable.append(c)
     if not satisfiable:
         return None

diff --git a/test-data/unit/check-unions.test b/test-data/unit/check-unions.test
--- a/test-data/unit/check-unions.test
+++ b/test-data/unit/check-unions.test
@@ -1171,6 +1171,25 @@ def foo(
 foo([1])
 [builtins fixtures/list.pyi]
 
+[case testGenericUnionMemberWithTypeVarConstraints]
+
+from typing import Generic, TypeVar, Union
+
+T = TypeVar('T', str, int)
+
+class C(Generic[T]): ...
+
+def f(s: Union[T, C[T]]) -> T:  ...
+
+ci: C[int]
+cs: C[str]
+
+reveal_type(f(1))  # N: Revealed type is "builtins.int"
+reveal_type(f(''))  # N: Revealed type is "builtins.str"
+reveal_type(f(ci))  # N: Revealed type is "builtins.int"
+reveal_type(f(cs))  # N: Revealed type is "builtins.str"
+
+
 [case testNestedInstanceTypeAliasUnsimplifiedUnion]
 from typing import TypeVar, Union, Iterator, List, Any
 T = TypeVar("T")

TypeVar in generic union member gets restricted to first constraint
In the below:
```
from typing import TypeVar, Generic, Union

AnyStr = TypeVar('AnyStr', str, bytes)

class PathLike(Generic[AnyStr]):
    def __fspath__(self) -> AnyStr: ...

def readlink(s: Union[AnyStr, PathLike[AnyStr]]) -> AnyStr:
    ...

class BP(PathLike[bytes]):
    def __fspath__(self) -> bytes:
        return b''

class SP(PathLike[str]):
    def __fspath__(self) -> str:
        return ''

reveal_type(readlink(''))
reveal_type(readlink(b''))
reveal_type(readlink(BP()))  # E: Argument 1 to "readlink" has incompatible type "BP"; expected "Union[str, PathLike[str]]"
reveal_type(readlink(SP()))
```
I ran mypy current master with no extra options.

The second to last line should type check and the type should be bytes, but instead mypy somehow expects `Union[str, PathLike[str]]`. If I switch around the order of the constraints on the TypeVar, it complains about the last line instead.

The following all make the error go away:
- Changing the argument type of readlink to `Union[str, PathLike[AnyStr]]`
- Changing the argument type to `Union[AnyStr, PathLike]`
Changing the order of the Union doesn't make a difference.

Guido found this bug in a comment on python/typeshed#1441. I couldn't find any other reports in the tracker, but wasn't sure what to search for.

Here's is a slightly simplified repro:

```py
from typing import TypeVar, Generic, Union

T = TypeVar('T', str, int)

class C(Generic[T]): ...

def f(s: Union[T, C[T]]) -> T:  ...

ci: C[int]
cs: C[str]

reveal_type(f(''))
reveal_type(f(1))
reveal_type(f(ci))  # Argument 1 to "f" has incompatible type C[int]; expected "Union[str, C[str]]"
reveal_type(f(cs))
```
This seems like another example of this issue (reported by a coworker):

```py
from typing import Callable, TypeVar, Generic, Union

_U = TypeVar('_U')
_T = TypeVar('_T')

class Future(Generic[_T]):
    
    def __init__(self, t: _T):
        self._t = t

    def then(self, fn: Callable[[_T], Future[_U]]) -> Future[_U]:
        return fn(self._t)
    
    def then2(self, fn: Callable[[_T], _U]) -> Future[_U]:
        return Future(fn(self._t))
        
    def then3(self, fn: Union[Callable[[_T], Future[_U]], Callable[[_T], _U]]) -> Future[_U]:
        ret = fn(self._t)
        if isinstance(ret, Future):
            return ret
        else:
            return Future(ret)

def foo(t: int) -> Future[str]:
    return Future("str")

fut = Future(5)

reveal_type(fut.then(foo)) # is a Future[str], good

def foo2(t: int) -> str:
    return "str"
    
reveal_type(fut.then2(foo2)) # also is a Future[str], good

reveal_type(fut.then3(foo)) # <<==== error, Future[<nothing>]
reveal_type(fut.then3(foo2)) 
```
mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionWithNoneItem mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnion1 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionSimplificationGenericFunction mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionAttributeAccess mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnion2 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionSimplificationGenericClass mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMethodCalls mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionWithEllipsis mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnion3 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testOptional mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionOrderEquivalence mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionIndexing mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionAnyIsInstance mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionWithNoReturn mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionSimplificationSpecialCases mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionAsOverloadArg mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionSimplificationSpecialCase2 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNestedUnionsProcessedCorrectly mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNarrowingDownNamedTupleUnion mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testAssignAnyToUnion mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionSimplificationSpecialCase3 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testSimplifyUnionWithCallable mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testAssignAnyToUnionWithAny mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionOperatorMethodSpecialCase mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionSimplificationSpecialCases2 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testSimplifyingUnionAndTypePromotions mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignSingle mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionSimplificationWithDuplicateItems mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionSimplificationWithBoolIntAndFloat mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testSimplifyingUnionWithTypeTypes1 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionSimplificationWithBoolIntAndFloat2 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignDouble mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testSimplifyingUnionWithTypeTypes2 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionAndBinaryOperation mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignPacked mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignGeneric mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNotSimplifyingUnionWithMetaclass mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignRebind mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnpackingUnionOfListsInFunction mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionOfNonIterableUnpacking mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignAny mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignAlreadyDeclared mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionOfVariableLengthTupleUnpacking mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testStringDisallowedUnpacking mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignNotJoin mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignIndexed mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionAlwaysTooFew mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionUnpackingChainedTuple2 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionAlwaysTooMany mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionMultiassignIndexedWithError mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionUnpackingChainedList mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionUnpackingChainedTuple3 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionUnpackingChainedTuple mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionUnpackingChainedList2 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionUnpackingInForTuple mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionUnpackingDoubleBinder mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionUnpackingFromNestedTuples mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNestedUnionUnpackingFromNestedTuples mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNestedUnionUnpackingFromNestedTuplesBinder mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnionUnpackingInForList mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnpackUnionNoCrashOnPartialNone mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testLongUnionFormatting mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnpackUnionNoCrashOnPartialNone2 mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnpackUnionNoCrashOnPartialNoneBinder mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testUnpackUnionNoCrashOnPartialNoneList mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNonStrictOptional mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testRecursiveForwardReferenceInUnion mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testAssignUnionWithTenaryExprWithEmptyCollection mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testInvariance mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testFlattenTypeAliasWhenAliasedAsUnion mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testJoinUnionWithUnionAndAny mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNestedProtocolUnions mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNestedProtocolGenericUnions mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNestedInstanceUnsimplifiedUnion mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNestedInstanceTypeAlias mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNestedProtocolGenericUnionsDeep mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testNestedInstanceTypeAliasUnsimplifiedUnion
mypy/test/testcheck.py::TypeCheckSuite::check-unions.test::testGenericUnionMemberWithTypeVarConstraints