diff --git a/edb/edgeql/compiler/schemactx.py b/edb/edgeql/compiler/schemactx.py index a60cbaa3c91..e1ce055e157 100644 --- a/edb/edgeql/compiler/schemactx.py +++ b/edb/edgeql/compiler/schemactx.py @@ -548,9 +548,7 @@ def apply_intersection( # of the argument, then this is, effectively, a NOP. return TypeIntersectionResult(stype=left) - if right.issubclass( - ctx.env.schema, left, check_opaque_unions=True, check_views=True - ): + if right.issubclass(ctx.env.schema, left): # The intersection type is a proper *subclass* and can be directly # narrowed. return TypeIntersectionResult( @@ -569,9 +567,7 @@ def apply_intersection( is_empty: bool = ( not s_utils.expand_type_expr_descendants(int_type, ctx.env.schema) ) - is_subtype: bool = int_type.issubclass( - ctx.env.schema, left, check_opaque_unions=True, check_views=True, - ) + is_subtype: bool = int_type.issubclass(ctx.env.schema, left) return TypeIntersectionResult( stype=int_type, diff --git a/edb/schema/objects.py b/edb/schema/objects.py index bcf37a01376..67c9de1e62f 100644 --- a/edb/schema/objects.py +++ b/edb/schema/objects.py @@ -3025,7 +3025,7 @@ class SubclassableObject(Object): ) def _issubclass( - self, schema: s_schema.Schema, parent: SubclassableObject, **kwargs: Any + self, schema: s_schema.Schema, parent: SubclassableObject ) -> bool: return parent == self @@ -3033,11 +3033,10 @@ def issubclass( self, schema: s_schema.Schema, parent: Union[SubclassableObject, Tuple[SubclassableObject, ...]], - **kwargs: Any, ) -> bool: from . import types as s_types if isinstance(parent, tuple): - return any(self.issubclass(schema, p, **kwargs) for p in parent) + return any(self.issubclass(schema, p) for p in parent) if ( isinstance(parent, s_types.Type) and parent.is_anyobject(schema) @@ -3048,7 +3047,7 @@ def issubclass( if isinstance(parent, s_types.Type) and parent.is_any(schema): return True - return self._issubclass(schema, parent, **kwargs) + return self._issubclass(schema, parent) InheritingObjectT = TypeVar('InheritingObjectT', bound='InheritingObject') diff --git a/edb/schema/types.py b/edb/schema/types.py index 32f426c5ce7..97e84646b08 100644 --- a/edb/schema/types.py +++ b/edb/schema/types.py @@ -1066,7 +1066,6 @@ def _issubclass( self, schema: s_schema.Schema, parent: so.SubclassableObject, - **kwargs: Any, ) -> bool: if isinstance(parent, Type) and parent.is_any(schema): return True @@ -1085,7 +1084,7 @@ def _issubclass( for pt, my in zip(parent_types, my_types): if ( not pt.is_any(schema) - and not my.issubclass(schema, pt, **kwargs) + and not my.issubclass(schema, pt) ): return False @@ -1098,15 +1097,14 @@ def issubclass( so.SubclassableObject, typing.Tuple[so.SubclassableObject, ...], ], - **kwargs: Any, ) -> bool: if isinstance(parent, tuple): - return any(self.issubclass(schema, p, **kwargs) for p in parent) + return any(self.issubclass(schema, p) for p in parent) if isinstance(parent, Type) and parent.is_any(schema): return True - return self._issubclass(schema, parent, **kwargs) + return self._issubclass(schema, parent) def get_subtypes(self, schema: s_schema.Schema) -> typing.Tuple[Type, ...]: raise NotImplementedError