o
    tBh                     @  s   d Z ddlmZ ddlmZ ddlmZmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZmZmZmZmZmZmZmZ dd	lmZ 	
ddddZdS )z!Type inference constraint solving    )annotations)defaultdict)SUPERTYPE_OF
Constraint)
join_types)
meet_types)
is_subtype)AnyType
ProperTypeType	TypeOfAny	TypeVarIdUninhabitedType	UnionTypeget_proper_type)	TypeStateTvarslist[TypeVarId]constraintslist[Constraint]strictboolreturnlist[Type | None]c                 C  sn  t t}|D ]
}||j | qg }| D ]}d}d}d}	||g D ]0}
|
jtkrE|du r2|
j}q#tj	r>t
||
jg}q#t||
j}q#|du rM|
j}q#t||
j}q#t|}t|}t|tsft|trt|trm|n|}t|tryt|ts{J |ttj|d q|du r|r|}	n |rt }	d|	_nttj}	n|du r|}	n
t||r|}	nd}	||	 q|S )a9  Solve type constraints.

    Return the best type(s) for type variables; each type can be None if the value of the variable
    could not be solved.

    If a variable has no constraints, if strict=True then arbitrarily
    pick NoneType as the value of the type variable.  If strict=False,
    pick AnyType.
    N)
source_anyT)r   listtype_varappendgetopr   targetr   infer_unionsr   
make_unionr   r   r   
isinstancer	   r
   r   from_another_anyr   	ambiguousspecial_formr   )r   r   r   cmapconrestvarbottomtop	candidatecp_topp_bottomr    r1   a/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/mypy/solve.pysolve_constraints   sN   

r3   N)T)r   r   r   r   r   r   r   r   )__doc__
__future__r   collectionsr   mypy.constraintsr   r   	mypy.joinr   	mypy.meetr   mypy.subtypesr   
mypy.typesr	   r
   r   r   r   r   r   r   mypy.typestater   r3   r1   r1   r1   r2   <module>   s    (
