Skip to content

Commit dc22a8b

Browse files
committed
Per review
1 parent 335c674 commit dc22a8b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

crates/ty_python_semantic/resources/mdtest/narrow/type_guards.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def _(a: tuple[str, int] | tuple[int, str], c: C[Any]):
216216
# TODO: Should be `str`
217217
reveal_type(a[1]) # revealed: Unknown
218218

219-
if reveal_type(is_int(a[0])): # revealed: TypeIs[int]
219+
if reveal_type(is_int(a[0])): # revealed: TypeIs[int](a[0])
220220
# TODO: Should be `tuple[int, str]`
221221
reveal_type(a) # revealed: tuple[str, int] | tuple[int, str]
222222
# TODO: Should be `int`
@@ -228,7 +228,7 @@ def _(a: tuple[str, int] | tuple[int, str], c: C[Any]):
228228
# TODO: Should be `str`
229229
reveal_type(c.v) # revealed: Any
230230

231-
if reveal_type(is_int(c.v)): # revealed: TypeIs[int]
231+
if reveal_type(is_int(c.v)): # revealed: TypeIs[int](c.v)
232232
reveal_type(c) # revealed: C[Any]
233233
# TODO: Should be `int`
234234
reveal_type(c.v) # revealed: Any

crates/ty_python_semantic/src/types.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8342,10 +8342,8 @@ impl<'db> TypeIsType<'db> {
83428342
pub fn place_name(self, db: &'db dyn Db) -> Option<String> {
83438343
let (scope, place) = self.place_info(db)?;
83448344
let table = place_table(db, scope);
8345-
let expr = table.place_expr(place);
83468345

8347-
// TODO: Attribute and subscript
8348-
expr.as_name().map(ToString::to_string)
8346+
Some(format!("{}", table.place_expr(place)))
83498347
}
83508348

83518349
pub fn unbound(db: &'db dyn Db, ty: Type<'db>) -> Type<'db> {

0 commit comments

Comments
 (0)