Skip to content

Commit b3d3ef3

Browse files
committed
[Test] Adds a test case
1 parent 5d1a1ff commit b3d3ef3

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
@@ -1683,3 +1683,17 @@ final class SR_11478_C2 {
16831683
@SR_11478_W class var bool2: Bool = true // expected-error {{class stored properties not supported in classes; did you mean 'static'?}}
16841684
@SR_11478_W class final var bool3: Bool = true // expected-error {{class stored properties not supported in classes; did you mean 'static'?}}
16851685
}
1686+
1687+
// SR-11381
1688+
1689+
@propertyWrapper
1690+
struct SR_11381_W<T> {
1691+
init(wrappedValue: T) {}
1692+
var wrappedValue: T {
1693+
fatalError()
1694+
}
1695+
}
1696+
1697+
struct SR_11381_S {
1698+
@SR_11381_W var foo: Int = nil // expected-error {{'nil' is not compatible with expected argument type 'Int'}}
1699+
}

0 commit comments

Comments
 (0)