mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This can't arise from a clean build, but it can happen if you have products lingering in a search path and then either rebuild one of the modules in the cycle, or change the search paths. The way this is implemented is for each module to track whether its imports have all been resolved. If, when loading a module, one of its dependencies hasn't resolved all of its imports yet, then we know there's a cycle. This doesn't produce the best diagnostics, but it's hard to get into this state in the first place, so that's probably okay. https://bugs.swift.org/browse/SR-7483
13 lines
525 B
Swift
13 lines
525 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -o %t %S/../../Inputs/empty.swift
|
|
// RUN: %target-swift-frontend -emit-module -o %t %s -I %t -module-name A
|
|
// RUN: rm %t/empty.swiftmodule
|
|
|
|
// RUN: not %sourcekitd-test -req=index %t/A.swiftmodule -- %t/A.swiftmodule 2>&1 | %FileCheck %s
|
|
|
|
import empty
|
|
|
|
// FIXME: Report the reason we couldn't load a module.
|
|
// CHECK-DISABLED: error response (Request Failed): missing module dependency
|
|
// CHECK: error response (Request Failed): failed to load module
|