Skip to content

Commit a83b8e8

Browse files
AlexWaygoodcarljm
andauthored
Apply suggestions from code review
Co-authored-by: Carl Meyer <[email protected]>
1 parent 72f8cec commit a83b8e8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

crates/red_knot_python_semantic/src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,7 @@ impl<'db> Type<'db> {
13861386
// are both of type Literal[345], for example.
13871387
false
13881388
}
1389+
// We eagerly transform `SubclassOf` to `ClassLiteral` for final types, so `SubclassOf` is never a singleton.
13891390
Type::SubclassOf(..) => false,
13901391
Type::BooleanLiteral(_)
13911392
| Type::FunctionLiteral(..)

crates/red_knot_python_semantic/src/types/subclass_of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::{ClassBase, ClassLiteralType, Db, KnownClass, Symbol, Type};
22

3-
/// A type that represents `type[C]`, i.e. the class literal `C` and class literals that are subclasses of `C`.
3+
/// A type that represents `type[C]`, i.e. the class object `C` and class objects that are subclasses of `C`.
44
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, salsa::Update)]
55
pub struct SubclassOfType<'db> {
66
// Keep this field private, so that the only way of constructing the struct is through the `from` method.

0 commit comments

Comments
 (0)