Skip to content

Commit b04f71f

Browse files
committed
fix(codex): correct $this handling in expansion
Signed-off-by: azjezz <[email protected]>
1 parent 24d7a54 commit b04f71f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/codex/src/ttype/expander.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,9 @@ fn expand_object(named_object: &mut TObject, codebase: &CodebaseMetadata, option
370370
}
371371
}
372372
StaticClassType::Name(static_class_name)
373-
if !is_this || codebase.is_instance_of(static_class_name, &name) =>
373+
if name_str_lc == "static"
374+
|| name_str_lc == "$this"
375+
|| codebase.is_instance_of(static_class_name, &name) =>
374376
{
375377
if let TObject::Named(named_object) = named_object {
376378
named_object.name = *static_class_name;
@@ -1192,7 +1194,7 @@ mod tests {
11921194

11931195
assert!(actual.types.iter().any(|t| {
11941196
if let TAtomic::Object(TObject::Named(named)) = t {
1195-
named.name == ascii_lowercase_atom("foo") && named.is_this
1197+
named.name == ascii_lowercase_atom("foo") && !named.is_this
11961198
} else {
11971199
false
11981200
}

0 commit comments

Comments
 (0)