Skip to content

Commit 930667e

Browse files
authored
Fix a hole in access control checking for var/let (#21168)
Previously if a declaration had both a Type and a TypeRepr available, we would only check the access of the TypeRepr. However, this is incomplete when the type is partially inferred, as in public var inferredGenericParameters: Optional = PrivateStruct() The new algorithm is to the Type first, then: - if the Type is okay, move on to check the TypeRepr - if the Type is not okay and we're in pre-Swift-5 mode, check the TypeRepr, and if /that's/ okay downgrade the whole thing to a warning. Unfortunately, we can't /just/ check the Type in the "good" case, because we don't always properly preserve sugar when going from a TypeRepr that represents a typealias to the corresponding Type, and we want to be able to fix those cases in the future. So we have to check both. rdar://problem/46596085 (cherry picked from commit a5947fe)
1 parent 7c76e4d commit 930667e

File tree

3 files changed

+119
-55
lines changed

3 files changed

+119
-55
lines changed

0 commit comments

Comments
 (0)