Skip to content

Commit 1eebe58

Browse files
committed
[Test] Adds a test case
1 parent e21c179 commit 1eebe58

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/decl/var/property_wrappers.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,3 +1131,17 @@ struct UseNonMutatingProjectedValueSet {
11311131
x = 42 // expected-error{{cannot assign to property: 'self' is immutable}}
11321132
}
11331133
}
1134+
1135+
// SR-11381
1136+
1137+
@propertyWrapper
1138+
struct SR_11381_W<T> {
1139+
init(wrappedValue: T) {}
1140+
var wrappedValue: T {
1141+
fatalError()
1142+
}
1143+
}
1144+
1145+
struct SR_11381_S {
1146+
@SR_11381_W var foo: Int = nil // expected-error {{'nil' is not compatible with expected argument type 'Int'}}
1147+
}

0 commit comments

Comments
 (0)