Skip to content

Commit aa7306d

Browse files
committed
---
yaml --- r: 342007 b: refs/heads/rxwei-patch-1 c: 9f0bc69 h: refs/heads/master i: 342005: ca872a5 342003: 5f05250 341999: 2588646
1 parent fa304a1 commit aa7306d

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
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: bd9b18ef65301ddaa28cf09267c096d6815a07ce
1018+
refs/heads/rxwei-patch-1: 9f0bc69edcc3e220575ae1033c001db09df7bc00
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/lib/Sema/TypeCheckDecl.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5313,7 +5313,6 @@ void TypeChecker::addImplicitConstructors(NominalTypeDecl *decl) {
53135313
}
53145314

53155315
} else {
5316-
SmallPtrSet<VarDecl *, 4> backingStorageVars;
53175316
for (auto member : decl->getMembers()) {
53185317
if (auto ctor = dyn_cast<ConstructorDecl>(member)) {
53195318
// Initializers that were synthesized to fulfill derived conformances
@@ -5336,17 +5335,9 @@ void TypeChecker::addImplicitConstructors(NominalTypeDecl *decl) {
53365335
}
53375336

53385337
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())
53505341
continue;
53515342

53525343
if (var->isMemberwiseInitialized(/*preferDeclaredProperties=*/true)) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
}

0 commit comments

Comments
 (0)