Swift scanner fails to analyze "internal import" declaration part of Swift 6

Hello,
When scanning Swift code written using Xcode 16, Swift scanner fails to analyze the code resulting in “Parse error” code smells.
This is our SonarQube setup:

  • SonarQube Enterprise Edition Version 9.9 (build 65466)
  • Swift Code Quality and Security 4.8.0.5759 (swift)
  • how is SonarQube deployed: Docker

Swift 6 introduces “internal import” declaration part of SE-0409. Additionally Xcode 16 produces build time warnings to replace “@_implementationOnly import” with “internal import”. When using “internal import” Swift scanner produces errors during scanning and reports “Parse error” code smells.

ERROR String is not parsed (file Example.swift, line 9)
1: //
2: //  Example.swift
3: //  ProjectName
4: //
5: //  Copyright 2024 Author. All rights reserved.
6: //
7:
8: import Foundation
9: internal import CoreComponents
^
11: import UIKit

Hi,

Per the docs, we don’t yet support Swift 6.

But if we did, it would be in the latest versions.

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

9.9.* → 2025.1

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

 
HTH,
Ann

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.