Skip to content

Commit 17a0b46

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 9847f6a commit 17a0b46

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
9+
import Foundation
10+
import library
11+
12+
public func rreplace(rgx: NSRegularExpression, in: String, with: String, x: NSRange) -> String {
13+
return replace(rgx: rgx, in: `in`, with: with, x: x)
14+
}

0 commit comments

Comments
 (0)