66
66
// RUN: c-index-test core -print-record %t/idx | %FileCheck -check-prefix=BROKEN-RECORD %s
67
67
// BROKEN-RECORD-NOT: function/Swift | systemFunc()
68
68
69
+ /// Subsequent builds won't attempt to index the broken swiftinterface again
69
70
// RUN: %target-swift-frontend -typecheck -parse-stdlib \
70
71
// RUN: -index-system-modules \
71
72
// RUN: -index-store-path %t/idx \
78
79
// RUN: 2>&1 | %FileCheck -check-prefix=BROKEN-BUILD-2 --allow-empty %s
79
80
// BROKEN-BUILD-2-NOT: indexing system module
80
81
82
+ /// Local errors should be preserved even when indexing against a broken swiftinterface
83
+ // RUN: %empty-directory(%t/idx)
84
+ // RUN: %empty-directory(%t/modulecache)
85
+ // RUN: not %target-swift-frontend -typecheck -parse-stdlib \
86
+ // RUN: -index-system-modules \
87
+ // RUN: -index-store-path %t/idx \
88
+ // RUN: -index-ignore-stdlib \
89
+ // RUN: -sdk %t/SDK \
90
+ // RUN: -Fsystem %t/SDK/Frameworks \
91
+ // RUN: -module-cache-path %t/modulecache \
92
+ // RUN: %t/ClientWithError.swift 2> %t/client-with-error.err
93
+ // RUN: cat %t/client-with-error.err | %FileCheck -check-prefix=WITH-ERROR %s
94
+ // WITH-ERROR: cannot convert return expression of type 'U' to return type 'T'
95
+
81
96
//--- SecretModule.swift
82
97
public struct SecretType { }
83
98
@@ -92,3 +107,12 @@ func leakyFunc(_ a: SecretType) { }
92
107
import SystemModule
93
108
94
109
public func clientFunc( ) { }
110
+
111
+ //--- ClientWithError.swift
112
+
113
+ import SystemModule
114
+ public func clientFunc( ) { }
115
+
116
+ struct T { }
117
+ struct U { }
118
+ func f( ) -> T { return U ( ) }
0 commit comments