$ the-wire · showcase
Flutter tool migrates Doctor, CustomDevices, and Install commands to constructor injection
By RepoJournal · Filed · About Mobile platforms
The Flutter tooling team completed the migration of three more commands to explicit constructor dependency injection, removing ambient global references and adding hermetic unit tests.
The Flutter engine and tooling remain in active cleanup. Part of the modular dependency injection migration, `DoctorCommand` [1], `CustomDevicesCommand` [2], and `InstallCommand` [3] now receive their dependencies explicitly through `ToolContext`, rather than reaching for ambient globals from `FlutterCommand`. Each change adds hermetic unit tests, which should make the tool easier to test and reason about internally. Nothing about the public command-line interface changes.
The Swift compiler gained several targeted improvements. Type-checking for subtyping now handles sync-versus-async type joins and function types, two previously unimplemented cases that the author plans to rely on in upcoming PRs [4]. For C++ interop, the compiler now checks that `@cxx` function signatures are representable in C++ and ensures the functions are never printed in generated headers, since they implement declarations already present in the imported header [5]. SILOptimizer also extended constant folding to `_stdlib_isVariantOSVersionAtLeast()` and `_stdlib_isOSVersionAtLeastOrVariantVersionAtLeast()`, removing unnecessary availability checks from zippered macOS libraries and macCatalyst modules; this matters because many low-level macOS libraries, including the standard library, are built zippered and were previously missing those optimizations [6]. Meanwhile, SILGen introduces an `end_formal_scope` marker, currently removed right away, that paves the way for a new lifetime resolution approach [7].
The Kotlin repository shows routine housekeeping across stdlib and IR. A fix for KT-88106 addresses the `dumpXcodebuildArgs` task failing when a package version changes from exact to `from`, and removes the deprecated `TestVersions.Gradle.G_8_0` [8]. Documentation for the deprecated common `kotlin.jvm.Synchronized` now includes a code snippet showing users how to write their own replacement annotation, since the deprecation message itself cannot carry KDoc due to a Dokka limitation [9]. Finally, `FinallyBlocksLowering` dropped a dead statement [10], and custom module indices were removed from `KonanIrLinker` [11].
Action items
- → Monitor Flutter tooling changes if you rely on flutter doctor, custom devices, or install commands; no CLI behavior change expected, but internal restructuring may surface new edge cases in development builds flutter/flutter [monitor]
- → Verify generated C++ header output if your project uses @cxx functions, to confirm no generated declarations are dropped apple/swift [plan]
- → No action required for Kotlin; the changes are internal or documentation-only JetBrains/kotlin [monitor]
References
- [1] [tool] Migrate DoctorCommand to modular dependency injection (#190758) ↗ flutter/flutter
- [2] [tool] Migrate CustomDevicesCommand to modular dependency injection (#190770) ↗ flutter/flutter
- [3] [tool] Migrate InstallCommand to modular dependency injection (#190771) ↗ flutter/flutter
- [4] Sema: Minor improvements to subtyping checks ↗ apple/swift
- [5] [cxx-interop] Check @cxx function signatures for C++ representability ↗ apple/swift
- [6] SILOptimizier: Expand constant folding for platform availability queries ↗ apple/swift
- [7] `end_formal_scope` SILGen markers ↗ apple/swift
- [8] [KT-88106] dumpXcodebuildArgs task fails on changing the package version from exact to from ↗ JetBrains/kotlin
- [9] [stdlib] Improve the docs of deprecated common k.jvm.Synchronized ↗ JetBrains/kotlin
- [10] [IR] Drop a dead statement in FinallyBlocksLowering ↗ JetBrains/kotlin
- [11] [Native] Drop custom module indices in KonanIrLinker ↗ JetBrains/kotlin