Skip to content

Commit aa3e409

Browse files
committed
Add a reproducer for issue 78447
#78447
1 parent b0bb19c commit aa3e409

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

test/Misc/Inputs/issue-78447-c.h

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;

test/Misc/Inputs/module.modulemap

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+
}

test/Misc/issue-78447.swift

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)