From 26daafaae3713cd94ce32354e6404d95e06c568c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 3 Jun 2026 01:57:34 +0900 Subject: feat(downcast): wire package/repo/filter instanceof checks via existing handle/as_any Resolve three category-4 TODO(phase-b) placeholders that were short-circuited to None/true, by routing them through downcast mechanisms that already exist: - package_sorter: PackageInterfaceHandle::as_root() for the instanceof RootPackageInterface check that adds dev-requires - platform_repository::is_complete_package: as_complete().is_some(), consistent with the inlined check already in add_package - create_project_command: PlatformRequirementFilterInterface::as_any() downcast to IgnoreAllPlatformRequirementFilter No new trait infrastructure introduced. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/command/create_project_command.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/command/create_project_command.rs') diff --git a/crates/shirabe/src/command/create_project_command.rs b/crates/shirabe/src/command/create_project_command.rs index e52fe39..90a4d99 100644 --- a/crates/shirabe/src/command/create_project_command.rs +++ b/crates/shirabe/src/command/create_project_command.rs @@ -830,9 +830,11 @@ impl CreateProjectCommand { format!("stability {}", stability) } ); - // TODO(phase-b): `$platformRequirementFilter instanceof IgnoreAllPlatformRequirementFilter` - let is_ignore_all: Option<&IgnoreAllPlatformRequirementFilter> = None; - if is_ignore_all.is_none() + let is_ignore_all = platform_requirement_filter + .as_any() + .downcast_ref::() + .is_some(); + if !is_ignore_all && version_selector .find_best_candidate( &name, -- cgit v1.3.1