Skip to content

Commit 076e0c0

Browse files
authored
Merge pull request #24994 from jckarter/SR-10264-test
Add regression test for SR-10264
2 parents 5b2891b + 3c0732a commit 076e0c0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
internal class TestClass {
2+
internal var field = "goodbye"
3+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-build-swift -force-single-frontend-invocation -c -o %t/Module.o -enable-testing -parse-as-library -emit-module -emit-module-path %t/Module.swiftmodule -module-name Module %S/Inputs/testable_key_path_2.swift
3+
// RUN: %target-build-swift -o %t/a.out -I %t %s %t/Module.o
4+
// RUN: %target-run %t/a.out | %FileCheck %s
5+
6+
// REQUIRES: executable_test
7+
8+
@testable import Module
9+
10+
let c = TestClass()
11+
12+
print("You say \(c.field)")
13+
14+
let kp = \TestClass.field
15+
16+
c[keyPath: kp] = "hello"
17+
18+
print("I say \(c.field)")
19+
20+
// CHECK: I say hello

0 commit comments

Comments
 (0)