Skip to content

Commit d311879

Browse files
committed
[Test] Move test case to compiler crashers
1 parent 2a2b600 commit d311879

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

test/SILGen/property_wrappers.swift

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -533,33 +533,14 @@ class ClassWrapper<T> {
533533
}
534534
}
535535

536-
537-
struct SR_11603_1 {
536+
struct SR_11603 {
538537
@StructWrapper @ClassWrapper var prop: Int
539538

540539
func foo() {
541540
prop = 1234
542541
}
543542
}
544543

545-
@propertyWrapper
546-
struct MutatingGetNonMutatingSetWrapper<T> {
547-
private var fixed: T
548-
549-
var wrappedValue: T {
550-
mutating get { fixed }
551-
nonmutating set { }
552-
}
553-
554-
init(wrappedValue initialValue: T) {
555-
fixed = initialValue
556-
}
557-
}
558-
559-
struct SR_11603_2 {
560-
@MutatingGetNonMutatingSetWrapper var text: String = ""
561-
}
562-
563544
// CHECK-LABEL: sil_vtable ClassUsingWrapper {
564545
// CHECK-NEXT: #ClassUsingWrapper.x!getter.1: (ClassUsingWrapper) -> () -> Int : @$s17property_wrappers17ClassUsingWrapperC1xSivg // ClassUsingWrapper.x.getter
565546
// CHECK-NEXT: #ClassUsingWrapper.x!setter.1: (ClassUsingWrapper) -> (Int) -> () : @$s17property_wrappers17ClassUsingWrapperC1xSivs // ClassUsingWrapper.x.setter
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: not --crash %target-swift-frontend -primary-file %s -emit-silgen
2+
3+
// REQUIRES: asserts
4+
5+
@propertyWrapper
6+
struct MutatingGetNonMutatingSetWrapper<T> {
7+
private var fixed: T
8+
9+
var wrappedValue: T {
10+
mutating get { fixed }
11+
nonmutating set { }
12+
}
13+
14+
init(wrappedValue initialValue: T) {
15+
fixed = initialValue
16+
}
17+
}
18+
19+
struct Foo {
20+
@MutatingGetNonMutatingSetWrapper var text: String
21+
}

0 commit comments

Comments
 (0)