Skip to content

Commit 59ef171

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-next
2 parents b2cb64c + 296afc7 commit 59ef171

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

test/Interpreter/unresolvable_dynamic_metadata_cycles.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,17 @@ var DynamicMetadataCycleTests =
3232

3333
enum test0_Node {
3434
case link(ResilientGenericStruct<test0_Node>)
35-
36-
static func test() -> [test0_Node] {
37-
return []
38-
}
3935
}
36+
37+
4038
DynamicMetadataCycleTests.test("cycle through enum")
4139
.crashOutputMatches("runtime error: unresolvable type metadata dependency cycle detected")
4240
.crashOutputMatches(" main.test0_Node")
4341
.crashOutputMatches(" depends on layout of resil.ResilientGenericStruct<main.test0_Node")
4442
.crashOutputMatches(" depends on layout of main.test0_Node")
4543
.code {
4644
expectCrashLater()
47-
_ = test0_Node.test()
45+
_blackHole(test0_Node.self)
4846
}
4947

5048
runAllTests()
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)