Skip to content

Commit

Permalink
Improve UnusedTypeDefinition replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Nov 28, 2023
1 parent 35e44da commit 2eb1526
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/analyzer/expr/call/arguments_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ pub(crate) fn check_arguments_match(
method_call_info = Some(MethodCallInfo {
self_fq_classlike_name,
declaring_method_id: Some(declaring_method_id),
classlike_storage: class_storage.unwrap(),
classlike_storage: if let Some(class_storage) = class_storage {
class_storage
} else {
return Err(AnalysisError::InternalError(
"Class storage does not exist".to_string(),
statements_analyzer.get_hpos(function_call_pos),
));
},
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/file_scanner_analyzer/unused_symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ pub(crate) fn find_unused_definitions(
);

if config
.migration_symbols
.contains_key(interner.lookup(type_name))
.issues_to_fix
.contains(&IssueKind::UnusedTypeDefinition)
{
analysis_result
.replacements
Expand Down

0 comments on commit 2eb1526

Please sign in to comment.