Skip to content

Commit 296afc7

Browse files
authored
[test] Add a test for SR-8493, so we don't regress (#19068)
https://bugs.swift.org/browse/SR-8493
1 parent 74c7bff commit 296afc7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class StateAnimatorGroup<State> {
2+
func add<T: StateAnimator>(_ animator: T) where T.State == State {}
3+
func set(_ state: State) {}
4+
}
5+
6+
extension StateAnimatorGroup: StateAnimator where State == String {}
7+
8+
protocol StateAnimator {
9+
associatedtype State
10+
11+
func set(_ state: State)
12+
}

validation-test/Sema/sr8493.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: cp %s %t/main.swift
3+
// RUN: %target-swift-frontend -primary-file %t/main.swift %S/Inputs/sr8493-helper.swift -emit-ir -o /dev/null
4+
5+
StateAnimatorGroup<String>().set("")

0 commit comments

Comments
 (0)