Skip to content

Commit adea32d

Browse files
alexisthedevtheosotr
authored andcommitted
Change name of dynamic_subtyping
1 parent 790fff8 commit adea32d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/ir/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
def two_way_subtyping(is_subtype):
22
def inner(self, other):
3-
return is_subtype(self, other) or other.dynamic_subtyping(self)
3+
return is_subtype(self, other) or other.two_way_subtyping(self)
44
return inner

src/ir/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ def has_type_variables(self):
6767
def is_subtype(self, other: Type):
6868
raise NotImplementedError("You have to implement 'is_subtype()'")
6969

70-
def dynamic_subtyping(self, other: Type):
70+
def two_way_subtyping(self, other: Type):
7171
"""
7272
Overwritten when a certain type needs
7373
two-way subtyping checks.
7474
7575
Eg. when checking if a string type is a subtype
7676
of union type 'Foo | string' we call this method
77-
as `union-type.dynamic_subtyping(string_type)`
77+
as `union-type.two_way_subtyping(string_type)`
7878
to check from the union's side.
7979
8080
"""

src/ir/typescript_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def is_subtype(self, other):
456456
return True
457457
return other.name == 'Object'
458458

459-
def dynamic_subtyping(self, other):
459+
def two_way_subtyping(self, other):
460460
return other in set(self.types)
461461

462462
def substitute_type_args(self, type_map,

0 commit comments

Comments
 (0)