File tree Expand file tree Collapse file tree 3 files changed +18
-13
lines changed
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 3 files changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
1015
1015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
1016
1016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
1017
1017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018
- refs/heads/rxwei-patch-1: bd9b18ef65301ddaa28cf09267c096d6815a07ce
1018
+ refs/heads/rxwei-patch-1: 9f0bc69edcc3e220575ae1033c001db09df7bc00
1019
1019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
1020
1020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
1021
1021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9
Original file line number Diff line number Diff line change @@ -5313,7 +5313,6 @@ void TypeChecker::addImplicitConstructors(NominalTypeDecl *decl) {
5313
5313
}
5314
5314
5315
5315
} else {
5316
- SmallPtrSet<VarDecl *, 4 > backingStorageVars;
5317
5316
for (auto member : decl->getMembers ()) {
5318
5317
if (auto ctor = dyn_cast<ConstructorDecl>(member)) {
5319
5318
// Initializers that were synthesized to fulfill derived conformances
@@ -5336,17 +5335,9 @@ void TypeChecker::addImplicitConstructors(NominalTypeDecl *decl) {
5336
5335
}
5337
5336
5338
5337
if (auto var = dyn_cast<VarDecl>(member)) {
5339
- // If this variable has a property wrapper, go validate it to ensure
5340
- // that we create the backing storage property.
5341
- if (auto backingVar = var->getPropertyWrapperBackingProperty ()) {
5342
- validateDecl (var);
5343
- maybeAddAccessorsToStorage (var);
5344
-
5345
- backingStorageVars.insert (backingVar);
5346
- }
5347
-
5348
- // Ignore the backing storage for properties with attached wrappers.
5349
- if (backingStorageVars.count (var) > 0 )
5338
+ // If this is a backing storage property for a property wrapper,
5339
+ // skip it.
5340
+ if (var->getOriginalWrappedProperty ())
5350
5341
continue ;
5351
5342
5352
5343
if (var->isMemberwiseInitialized (/* preferDeclaredProperties=*/ true )) {
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -typecheck %s -verify
2
+
3
+ public protocol MyBindableObject { }
4
+
5
+ @propertyWrapper
6
+ public struct MyBinding < T> where T : MyBindableObject { // expected-error{{internal initializer 'init(wrappedValue:)' cannot have more restrictive access than its enclosing property wrapper type 'MyBinding' (which is public)}}
7
+ public var wrappedValue : T
8
+ }
9
+ class BeaconDetector : MyBindableObject {
10
+ @MyBinding var detector = BeaconDetector ( )
11
+ init ( ) {
12
+ detector. undefined = 45 // expected-error{{value of type 'BeaconDetector' has no member 'undefined'}}
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments