Skip to content

Commit da2fb2f

Browse files
committed
Add test case for imported conformance usage after Sema tear-down
This test used to fail because we would look up an associated type in an incomplete conformance after Sema was torn down, causing a crash. Now, the ClangImporter is able to correctly complete the conformance.
1 parent 9c6cd08 commit da2fb2f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: true
2+
3+
import Foundation
4+
5+
@inline(__always)
6+
public func replace(rgx: NSRegularExpression, in: String, with: String, x: NSRange) -> String {
7+
return rgx.stringByReplacingMatches(in: `in`, options: [], range: x, withTemplate: with)
8+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %empty-directory(%t)
2+
3+
// RUN: %empty-directory(%t/linker)
4+
// RUN: %target-build-swift -emit-module -emit-library %S/library.swift -o %t/linker/liblibrary.%target-dylib-extension -emit-module-path %t/linker/library.swiftmodule -module-name library
5+
// RUN: %target-build-swift %S/main.swift -I %t/linker/ -L %t/linker/ -llibrary -o %t/linker/main
6+
7+
// REQUIRES: executable_test
8+
// REQUIRES: objc_interop
9+
10+
import Foundation
11+
import library
12+
13+
public func rreplace(rgx: NSRegularExpression, in: String, with: String, x: NSRange) -> String {
14+
return replace(rgx: rgx, in: `in`, with: with, x: x)
15+
}

0 commit comments

Comments
 (0)