Skip to content

Commit 1d8e48d

Browse files
authored
Merge pull request #78563 from hjyamauchi/issue78447
Add a reproducer for issue 78447
2 parents 73b184d + 7abb94a commit 1d8e48d

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
typedef struct _xmlNs {
2+
const char *prefix;
3+
} *xmlNsPtr;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module Issue_78447_C {
2+
header "issue-78447-c.h"
3+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %target-build-swift %s -I %S/Inputs
2+
3+
import Issue_78447_C
4+
5+
func foo<T> (ptr: UnsafePointer<T>?) -> String? {
6+
return nil
7+
}
8+
9+
class A {
10+
internal let ptr: xmlNsPtr
11+
internal init(ptr: xmlNsPtr) {
12+
self.ptr = ptr
13+
}
14+
}
15+
16+
class B : A {
17+
func bar() -> String? {
18+
return foo(ptr: ptr.pointee.prefix)
19+
}
20+
}

0 commit comments

Comments
 (0)