Return one of types (expanded) if it is a subtype of other, otherwise bottom type.
(s: Type, t: Type)
| 59 | |
| 60 | |
| 61 | def trivial_meet(s: Type, t: Type) -> ProperType: |
| 62 | """Return one of types (expanded) if it is a subtype of other, otherwise bottom type.""" |
| 63 | if is_subtype(s, t): |
| 64 | return get_proper_type(s) |
| 65 | elif is_subtype(t, s): |
| 66 | return get_proper_type(t) |
| 67 | else: |
| 68 | if state.strict_optional: |
| 69 | return UninhabitedType() |
| 70 | else: |
| 71 | return NoneType() |
| 72 | |
| 73 | |
| 74 | def meet_types(s: Type, t: Type) -> ProperType: |
no test coverage detected
searching dependent graphs…