Skip to content

Cross import overlays seem broken #152

Closed

Description

@kabiroberai

Description

Cross-import overlays don't seem to be imported automatically. For example,

import SwiftUI
import MapKit

@MainActor let map = Map() // Cannot find 'Map' in scope

Importing the cross-import overlay manually fixes this

 import SwiftUI
 import MapKit
+import _MapKit_SwiftUI

 @MainActor let map = Map() // works!

I'm not sure if this is an issue with all overlays or just MapKit. Haven't checked any others yet.

Environment

Host OS: Ubuntu 24.04.3 LTS
Swift version: swift-6.1-RELEASE
SDK version: iOS 18.5

Activity

  1. added
    bug
    on Aug 10, 2025
  2. kabiroberai commented on Aug 10, 2025

    @kabiroberai
    MemberAuthor

    Seems like we need to pass -Xfrontend -enable-cross-import-overlays to Swift invocations

  3. kabiroberai commented on Aug 10, 2025

    @kabiroberai
    MemberAuthor
    swift build \
      --swift-sdk arm64-apple-ios \
      -Xswiftc -Xfrontend -Xswiftc -enable-cross-import-overlays

    works

  4. kabiroberai commented on Aug 10, 2025

    @kabiroberai
    MemberAuthor

    actually we should maybe add this to the SwiftSDK settings so that SourceKit-LSP picks it up

  5. added a commit that references this issue on Oct 26, 2025
    96032d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions