mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge remote-tracking branch 'origin/master' into master-next
This commit is contained in:
@@ -2912,6 +2912,9 @@ public:
|
||||
private:
|
||||
/// Predicate used to filter StoredPropertyRange.
|
||||
struct ToStoredProperty {
|
||||
ToStoredProperty(bool skipInaccessible = false) :
|
||||
skipUserInaccessible(skipInaccessible) {}
|
||||
bool skipUserInaccessible;
|
||||
Optional<VarDecl *> operator()(Decl *decl) const;
|
||||
};
|
||||
|
||||
@@ -2921,8 +2924,9 @@ public:
|
||||
ToStoredProperty>;
|
||||
|
||||
/// Return a collection of the stored member variables of this type.
|
||||
StoredPropertyRange getStoredProperties() const {
|
||||
return StoredPropertyRange(getMembers(), ToStoredProperty());
|
||||
StoredPropertyRange getStoredProperties(bool skipInaccessible = false) const {
|
||||
return StoredPropertyRange(getMembers(),
|
||||
ToStoredProperty(skipInaccessible));
|
||||
}
|
||||
|
||||
// Implement isa/cast/dyncast/etc.
|
||||
@@ -6119,7 +6123,8 @@ inline bool ValueDecl::isSettable(const DeclContext *UseDC,
|
||||
inline Optional<VarDecl *>
|
||||
NominalTypeDecl::ToStoredProperty::operator()(Decl *decl) const {
|
||||
if (auto var = dyn_cast<VarDecl>(decl)) {
|
||||
if (!var->isStatic() && var->hasStorage())
|
||||
if (!var->isStatic() && var->hasStorage() &&
|
||||
(!skipUserInaccessible || var->isUserAccessible()))
|
||||
return var;
|
||||
}
|
||||
|
||||
|
||||
@@ -1966,6 +1966,12 @@ ERROR(broken_int_integer_literal_convertible_conformance,none,
|
||||
"Int type is broken: does not conform to ExpressibleByIntegerLiteral", ())
|
||||
ERROR(no_equal_overload_for_int,none,
|
||||
"no overload of '==' for Int", ())
|
||||
ERROR(broken_coding_key_requirement,none,
|
||||
"CodingKey protocol is broken: unexpected requirement", ())
|
||||
ERROR(broken_encodable_requirement,none,
|
||||
"Encodable protocol is broken: unexpected requirement", ())
|
||||
ERROR(broken_decodable_requirement,none,
|
||||
"Decodable protocol is broken: unexpected requirement", ())
|
||||
|
||||
// Dynamic Self
|
||||
ERROR(dynamic_self_non_method,none,
|
||||
|
||||
@@ -29,24 +29,40 @@ IDENTIFIER(Any)
|
||||
IDENTIFIER(atIndexedSubscript)
|
||||
IDENTIFIER_(bridgeToObjectiveC)
|
||||
IDENTIFIER_WITH_NAME(code_, "_code")
|
||||
IDENTIFIER(CodingKeys)
|
||||
IDENTIFIER(container)
|
||||
IDENTIFIER(CoreGraphics)
|
||||
IDENTIFIER(CoreMedia)
|
||||
IDENTIFIER(CGFloat)
|
||||
IDENTIFIER(CVarArg)
|
||||
IDENTIFIER(Darwin)
|
||||
IDENTIFIER(dealloc)
|
||||
IDENTIFIER(Decodable)
|
||||
IDENTIFIER(decode)
|
||||
IDENTIFIER(Decoder)
|
||||
IDENTIFIER(decoder)
|
||||
IDENTIFIER(deinit)
|
||||
IDENTIFIER(Element)
|
||||
IDENTIFIER(Encodable)
|
||||
IDENTIFIER(encode)
|
||||
IDENTIFIER(Encoder)
|
||||
IDENTIFIER(encoder)
|
||||
IDENTIFIER(error)
|
||||
IDENTIFIER(forKeyedSubscript)
|
||||
IDENTIFIER(Foundation)
|
||||
IDENTIFIER(forKey)
|
||||
IDENTIFIER(from)
|
||||
IDENTIFIER(fromRaw)
|
||||
IDENTIFIER(hashValue)
|
||||
IDENTIFIER(init)
|
||||
IDENTIFIER(initialize)
|
||||
IDENTIFIER(initStorage)
|
||||
IDENTIFIER(initialValue)
|
||||
IDENTIFIER(intValue)
|
||||
IDENTIFIER(Key)
|
||||
IDENTIFIER(KeyedDecodingContainer)
|
||||
IDENTIFIER(KeyedEncodingContainer)
|
||||
IDENTIFIER(keyedBy)
|
||||
IDENTIFIER(keyPath)
|
||||
IDENTIFIER(makeIterator)
|
||||
IDENTIFIER(Iterator)
|
||||
@@ -70,10 +86,16 @@ IDENTIFIER(setObject)
|
||||
IDENTIFIER(simd)
|
||||
IDENTIFIER(some)
|
||||
IDENTIFIER(storage)
|
||||
IDENTIFIER(stringValue)
|
||||
IDENTIFIER(subscript)
|
||||
IDENTIFIER(super)
|
||||
IDENTIFIER(superDecoder)
|
||||
IDENTIFIER(superEncoder)
|
||||
IDENTIFIER(SwiftObject)
|
||||
IDENTIFIER(to)
|
||||
IDENTIFIER(toRaw)
|
||||
IDENTIFIER(Type)
|
||||
IDENTIFIER(type)
|
||||
IDENTIFIER(Value)
|
||||
IDENTIFIER(value)
|
||||
IDENTIFIER_WITH_NAME(value_, "_value")
|
||||
|
||||
@@ -60,6 +60,9 @@ PROTOCOL_(ErrorCodeProtocol)
|
||||
PROTOCOL(OptionSet)
|
||||
PROTOCOL_(BridgedNSError)
|
||||
PROTOCOL_(BridgedStoredNSError)
|
||||
PROTOCOL(CodingKey)
|
||||
PROTOCOL(Encodable)
|
||||
PROTOCOL(Decodable)
|
||||
|
||||
PROTOCOL_(ObjectiveCBridgeable)
|
||||
PROTOCOL_(DestructorSafeContainer)
|
||||
|
||||
@@ -71,4 +71,9 @@ KNOWN_STDLIB_TYPE_DECL(Unmanaged, NominalTypeDecl, 1)
|
||||
|
||||
KNOWN_STDLIB_TYPE_DECL(Never, NominalTypeDecl, 0)
|
||||
|
||||
KNOWN_STDLIB_TYPE_DECL(Encoder, ProtocolDecl, 1)
|
||||
KNOWN_STDLIB_TYPE_DECL(Decoder, ProtocolDecl, 1)
|
||||
KNOWN_STDLIB_TYPE_DECL(KeyedEncodingContainer, NominalTypeDecl, 1)
|
||||
KNOWN_STDLIB_TYPE_DECL(KeyedDecodingContainer, NominalTypeDecl, 1)
|
||||
|
||||
#undef KNOWN_STDLIB_TYPE_DECL
|
||||
|
||||
Reference in New Issue
Block a user