Skip to content

Commit b5694e9

Browse files
committed
fix 28241-swift-valuedecl-isaccessiblefrom.swift
1 parent 22e5ad8 commit b5694e9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,8 @@ void CalleeCandidateInfo::filterList(ClosenessPredicate predicate) {
911911

912912
// Likewise, if the candidate is inaccessible from the scope it is being
913913
// accessed from, mark it as inaccessible or a general mismatch.
914-
if (!VD->isAccessibleFrom(CS->DC)) {
914+
if (VD->hasAccessibility() &&
915+
!VD->isAccessibleFrom(CS->DC)) {
915916
// If this was an exact match, downgrade it to inaccessible, so that
916917
// accessible decls that are also an exact match will take precedence.
917918
// Otherwise consider it to be a general mismatch so we only list it in

validation-test/compiler_crashers/28241-swift-valuedecl-isaccessiblefrom.swift renamed to validation-test/compiler_crashers_fixed/28241-swift-valuedecl-isaccessiblefrom.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// RUN: not --crash %target-swift-frontend %s -parse
2-
// REQUIRES: asserts
1+
// RUN: not %target-swift-frontend %s -parse
32

43
// Distributed under the terms of the MIT license
54
// Test case submitted to project by https://github.com/practicalswift (practicalswift)

0 commit comments

Comments
 (0)