Skip to content

Commit 8c9f225

Browse files
committed
---
yaml --- r: 341477 b: refs/heads/rxwei-patch-1 c: c195fdc h: refs/heads/master i: 341475: a9bae3e
1 parent 625211a commit 8c9f225

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 626b93cca20fe4b70fbc7cd4ba0495ddc2deac17
1018+
refs/heads/rxwei-patch-1: c195fdcc5c0419e72c81918cebea7650091c57b8
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/test/decl/var/property_wrappers.swift

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,16 @@ struct Foo<T> { // expected-note {{arguments to generic parameter 'T' ('W' and '
944944
get { return 42 }
945945
set { }
946946
}
947+
948+
subscript(x x: Int) -> Int {
949+
get { return 42 }
950+
set { }
951+
}
952+
953+
subscript(q q: String, a: Int) -> Bool {
954+
get { return false }
955+
set { }
956+
}
947957
}
948958

949959
@propertyWrapper
@@ -1021,13 +1031,19 @@ struct MissingPropertyWrapperUnwrap {
10211031

10221032
self.x["ultimate question"] // expected-error {{referencing subscript 'subscript(_:)' requires wrapper 'Foo<Int>'}} {{10-10=_}}
10231033
self.x["ultimate question"] = 42 // expected-error {{referencing subscript 'subscript(_:)' requires wrapper 'Foo<Int>'}} {{10-10=_}}
1034+
1035+
self.x[x: 42] // expected-error {{referencing subscript 'subscript(x:)' requires wrapper 'Foo<Int>'}} {{10-10=_}}
1036+
self.x[x: 42] = 0 // expected-error {{referencing subscript 'subscript(x:)' requires wrapper 'Foo<Int>'}} {{10-10=_}}
1037+
1038+
self.x[q: "ultimate question", 42] // expected-error {{referencing subscript 'subscript(q:_:)' requires wrapper 'Foo<Int>'}} {{10-10=_}}
1039+
self.x[q: "ultimate question", 42] = true // expected-error {{referencing subscript 'subscript(q:_:)' requires wrapper 'Foo<Int>'}} {{10-10=_}}
10241040
}
10251041
}
10261042

10271043
struct InvalidPropertyDelegateUse {
10281044
@Foo var x: Int = 42 // expected-error {{extra argument 'initialValue' in call}}
10291045

10301046
func test() {
1031-
self.x.foo() // expected-error {{alue of type 'Int' has no member 'foo'}}
1047+
self.x.foo() // expected-error {{value of type 'Int' has no member 'foo'}}
10321048
}
10331049
}

0 commit comments

Comments
 (0)