Skip to content

Commit da9a19b

Browse files
committed
fixup! [Sema] Add fix-it for property in protocol
1 parent 7ae9eb7 commit da9a19b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/decl/var/properties.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,9 @@ protocol ProtocolWillSetDidSet3 {
881881
protocol ProtocolWillSetDidSet4 {
882882
var a: Int { didSet willSet } // expected-error {{property in protocol must have explicit { get } or { get set } specifier}} {{14-32={ get <#set#> \}}} expected-error 2 {{expected get or set in a protocol property}}
883883
}
884+
protocol ProtocolWillSetDidSet5 {
885+
let a: Int { didSet willSet } // expected-error {{property in protocol must have explicit { get } or { get set } specifier}} {{14-32={ get <#set#> \}}} {{none}} expected-error 2 {{expected get or set in a protocol property}} expected-error {{'let' declarations cannot be computed properties}} {{3-6=var}}
886+
}
884887

885888
var globalDidsetWillSet: Int { // expected-error {{non-member observing properties require an initializer}}
886889
didSet {}

0 commit comments

Comments
 (0)