Skip to content

Enable strict compiler warnings and fix compilation issues#3

Merged
linroid merged 8 commits intomainfrom
claude/resolve-code-warnings-TtoDq
Feb 7, 2026
Merged

Enable strict compiler warnings and fix compilation issues#3
linroid merged 8 commits intomainfrom
claude/resolve-code-warnings-TtoDq

Conversation

@linroid
Copy link
Owner

@linroid linroid commented Feb 7, 2026

Summary

This PR enables strict Kotlin compiler settings to treat all warnings as errors across all subprojects, and fixes the resulting compilation warnings.

Key Changes

  • Build Configuration: Added allWarningsAsErrors = true to Kotlin compilation tasks in all subprojects to enforce stricter code quality standards
  • DownloadCoordinator.kt:
    • Changed var metadata to val metadata in startDownload() since it's never reassigned
    • Removed unused lastError variable from executeDownloadWithRetry()
    • Removed unnecessary reassignment of metadata in the retry loop
  • FileAccessor.ios.kt: Removed unused import of NSFileSize
  • KtorHttpEngine.kt:
    • Removed unused import of HttpStatusCode
    • Simplified HTTP status check by removing redundant PartialContent condition

Implementation Details

The compiler now enforces that all warnings must be resolved, improving code quality and maintainability. All changes are minimal and focused on removing unused variables and imports while maintaining existing functionality.

https://claude.ai/code/session_01S8MTGDRyF33yD1HegbWbPF

- Change var to val for metadata in DownloadCoordinator.executeDownload (never reassigned)
- Remove unused lastError variable in DownloadCoordinator.downloadWithRetry
- Remove unused return value assignment from downloadSegments call
- Remove unused NSFileSize import in iOS FileAccessor
- Remove redundant PartialContent check and unused HttpStatusCode import in KtorHttpEngine

https://claude.ai/code/session_01S8MTGDRyF33yD1HegbWbPF
Configures the Kotlin compiler to treat all warnings as errors across
all subprojects, ensuring code warnings are caught at build time.

https://claude.ai/code/session_01S8MTGDRyF33yD1HegbWbPF
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

Test Results

318 tests  ±0   318 ✅ ±0   0s ⏱️ ±0s
 36 suites ±0     0 💤 ±0 
 36 files   ±0     0 ❌ ±0 

Results for commit 05bdeee. ± Comparison against base commit fa0075f.

♻️ This comment has been updated with latest results.

- TimeProvider: Replace deprecated @ExperimentalTime opt-in with stable
  kotlinx.datetime.Clock (already a project dependency)
- DownloadRequest: Remove @ExperimentalUuidApi opt-in since Uuid is
  stable in Kotlin 2.3.0

These produced deprecation/unnecessary opt-in warnings which are now
errors due to allWarningsAsErrors.

https://claude.ai/code/session_01S8MTGDRyF33yD1HegbWbPF
Suppresses the expect/actual classes warning for KMP modules that use
expect class declarations (e.g., FileAccessor).

https://claude.ai/code/session_01S8MTGDRyF33yD1HegbWbPF
Configures compiler-level opt-in so individual source files don't need
@OptIn annotations for these experimental APIs.

https://claude.ai/code/session_01S8MTGDRyF33yD1HegbWbPF
The ExperimentalTime opt-in is already configured globally in the root
build script.

https://claude.ai/code/session_01S8MTGDRyF33yD1HegbWbPF
@linroid linroid merged commit 1a864fb into main Feb 7, 2026
6 checks passed
@linroid linroid deleted the claude/resolve-code-warnings-TtoDq branch February 9, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants