Skip to content

Commit a2b48db

Browse files
committed
clean up comments
1 parent bd16312 commit a2b48db

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

crates/ty_python_semantic/src/types.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,11 @@ impl<'db> Type<'db> {
11701170
target.is_equivalent_to(db, Type::object(db))
11711171
}
11721172

1173+
// These clauses handle type variants that include function literals. A function
1174+
// literal is the subtype of itself, and not of any other function literal. However,
1175+
// our representation of a function literal includes any specialization that should be
1176+
// applied to the signature. Different specializations of the same function literal are
1177+
// only subtypes of each other if they result in the same signature.
11731178
(Type::FunctionLiteral(self_function), Type::FunctionLiteral(target_function)) => {
11741179
self_function.is_subtype_of(db, target_function)
11751180
}
@@ -1514,6 +1519,11 @@ impl<'db> Type<'db> {
15141519
true
15151520
}
15161521

1522+
// These clauses handle type variants that include function literals. A function
1523+
// literal is assignable to itself, and not to any other function literal. However, our
1524+
// representation of a function literal includes any specialization that should be
1525+
// applied to the signature. Different specializations of the same function literal are
1526+
// only assignable to each other if they result in the same signature.
15171527
(Type::FunctionLiteral(self_function), Type::FunctionLiteral(target_function)) => {
15181528
self_function.is_assignable_to(db, target_function)
15191529
}
@@ -6942,9 +6952,7 @@ impl<'db> FunctionType<'db> {
69426952
// A function literal is the subtype of itself, and not of any other function literal.
69436953
// However, our representation of a function literal includes any specialization that
69446954
// should be applied to the signature. Different specializations of the same function
6945-
// literal are only subtypes of each other if they result in the same signature. (Note that
6946-
// the equality check above will have already handled the case where `self` and `target`
6947-
// are the same function literal with the same specialization.)
6955+
// literal are only subtypes of each other if they result in the same signature.
69486956
self.body_scope(db) == other.body_scope(db)
69496957
&& self
69506958
.into_callable_type(db)
@@ -6955,9 +6963,7 @@ impl<'db> FunctionType<'db> {
69556963
// A function literal is assignable to itself, and not to any other function literal.
69566964
// However, our representation of a function literal includes any specialization that
69576965
// should be applied to the signature. Different specializations of the same function
6958-
// literal are only assignable to each other if they result in the same signature. (Note
6959-
// that the equality check above will have already handled the case where `self` and
6960-
// `target` are the same function literal with the same specialization.)
6966+
// literal are only assignable to each other if they result in the same signature.
69616967
self.body_scope(db) == other.body_scope(db)
69626968
&& self
69636969
.into_callable_type(db)

0 commit comments

Comments
 (0)