Skip to content

Commit 5df8897

Browse files
committed
[SE-0258] Add a test for non-final properties with wrappers.
These were banned by the proposal, but not the implementation. Add a test to make sure the two are in agreement.
1 parent 9468edd commit 5df8897

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/decl/var/property_delegates.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@ class Superclass {
169169
var x: Int = 0
170170
}
171171

172+
class SubclassOfClassWithDelegates: ClassWithDelegates {
173+
override var x: Int {
174+
get { return $x.value }
175+
set { $x.value = newValue }
176+
}
177+
}
178+
172179
class SubclassWithDelegate: Superclass {
173180
@Wrapper(value: 17)
174181
override var x: Int { get { return 0 } set { } } // expected-error{{property 'x' with attached delegate cannot override another property}}
@@ -593,7 +600,7 @@ struct NoDefaultInitializerStruct { // expected-note{{'init(x:)' declared here}}
593600

594601
class DefaultInitializerClass {
595602
@Wrapper(value: true)
596-
final var x
603+
var x
597604

598605
@WrapperWithInitialValue
599606
final var y: Int = 10

0 commit comments

Comments
 (0)