Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Sema/CodeSynthesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ ConstructorDecl *swift::getOrCreateEffectiveMemberwiseInitializer(
for (auto *member : nominal->getMembers()) {
auto var = dyn_cast<VarDecl>(member);
if (!var ||
!var->isMemberwiseInitialized(/*preferDeclaredProperties=*/true))
!var->isMemberwiseInitialized(/*preferDeclaredProperties*/ true))
continue;
accessLevel = std::min(accessLevel, var->getFormalAccess());
}
Expand Down
8 changes: 5 additions & 3 deletions test/Sema/differentiable_access_level.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// SWIFT_ENABLE_TENSORFLOW
// RUN: %target-swift-frontend -print-ast %s | %FileCheck %s

// Test `Differentiable` derived conformances.
// Verify access levels of synthesized `TangentVector` types and their memberwise initializers.
// `TangentVector` memberwise initializer access level should match `TangentVector` access level.
// TF-1077: Verify access levels of `TangentVector` types and their memberwise
// initializers, synthesized during `Differentiable` derived conformances.

// `TangentVector` memberwise initializer access level should default to true,
// for usability.

public struct PublicStruct: Differentiable {}
internal struct InternalStruct: Differentiable {}
Expand Down