diff --git a/docs/WindowsBuild.md b/docs/WindowsBuild.md index 119496aa4cade..0ca8b656501ff 100644 --- a/docs/WindowsBuild.md +++ b/docs/WindowsBuild.md @@ -79,19 +79,19 @@ git clone https://github.com/compnerd/swift-build swift-build ## Acquire ICU, SQLite3, curl, libxml2 and zlib ``` -python -m pip install --user msrest azure-devops tabulate -python swift-build\utilities\swift-build.py --build-id ICU --latest-artifacts --filter windows-x64 --download -python swift-build\utilities\swift-build.py --build-id XML2 --latest-artifacts --filter windows-x64 --download -python swift-build\utilities\swift-build.py --build-id CURL --latest-artifacts --filter windows-x64 --download -python swift-build\utilities\swift-build.py --build-id zlib --latest-artifacts --filter windows-x64 --download -python swift-build\utilities\swift-build.py --build-id SQLite --latest-artifacts --filter windows-x64 --download +C:\Python27\python.exe -m pip install --user msrest azure-devops tabulate +C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id ICU --latest-artifacts --filter windows-x64 --download +C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id XML2 --latest-artifacts --filter windows-x64 --download +C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id CURL --latest-artifacts --filter windows-x64 --download +C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id zlib --latest-artifacts --filter windows-x64 --download +C:\Python27\python.exe swift-build\utilities\swift-build.py --build-id SQLite --latest-artifacts --filter windows-x64 --download ``` Extract the zip files, ignoring the top level directory, into `S:/Library`. The directory structure should resemble: ``` /Library - ┝ icu-64 + ┝ icu-67 │ ┕ usr/... ├ libcurl-development │ ┕ usr/... @@ -138,10 +138,10 @@ cmake -B "S:\b\toolchain" ^ -D LLDB_ENABLE_PYTHON=YES ^ -D LLVM_EXTERNAL_SWIFT_SOURCE_DIR="S:/swift" ^ -D LLVM_EXTERNAL_CMARK_SOURCE_DIR="S:/cmark" ^ - -D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="S:/Library/icu-64/usr/include" ^ - -D SWIFT_WINDOWS_x86_64_ICU_UC="S:/Library/icu-64/usr/lib/icuuc64.lib" ^ - -D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="S:/Library/icu-64/usr/include" ^ - -D SWIFT_WINDOWS_x86_64_ICU_I18N="S:/Library/icu-64/usr/lib/icuin64.lib" ^ + -D SWIFT_WINDOWS_x86_64_ICU_UC_INCLUDE="S:/Library/icu-67/usr/include" ^ + -D SWIFT_WINDOWS_x86_64_ICU_UC="S:/Library/icu-67/usr/lib/icuuc67.lib" ^ + -D SWIFT_WINDOWS_x86_64_ICU_I18N_INCLUDE="S:/Library/icu-67/usr/include" ^ + -D SWIFT_WINDOWS_x86_64_ICU_I18N="S:/Library/icu-67/usr/lib/icuin67.lib" ^ -D CMAKE_INSTALL_PREFIX="C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr" ^ -D PYTHON_EXECUTABLE=C:\Python27\python.exe ^ -D SWIFT_BUILD_DYNAMIC_STDLIB=YES ^ @@ -158,7 +158,7 @@ ninja -C S:\b\toolchain ## Running Swift tests on Windows ```cmd -path S:\Library\icu-64\usr\bin;S:\b\toolchain\bin;S:\b\toolchain\tools\swift\libdispatch-prefix\bin;%PATH%;%ProgramFiles%\Git\usr\bin +path S:\Library\icu-67\usr\bin;S:\b\toolchain\bin;S:\b\toolchain\tools\swift\libdispatch-prefix\bin;%PATH%;%ProgramFiles%\Git\usr\bin ninja -C S:\b\toolchain check-swift ``` @@ -178,7 +178,7 @@ ninja -C S:\b\libdispatch check ## Build swift-corelibs-foundation ```cmd -cmake -B S:\b\foundation -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=S:/b/toolchain/bin/clang-cl.exe -D CMAKE_Swift_COMPILER=S:/b/toolchain/bin/swiftc.exe -D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" -D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" -D ICU_ROOT="S:/Library/icu-64" -D ICU_INCLUDE_DIR=S:/Library/icu-64/usr/include -D LIBXML2_LIBRARY="S:/Library/libxml2-development/usr/lib/libxml2s.lib" -D LIBXML2_INCLUDE_DIR="S:/Library/libxml2-development/usr/include/libxml2" -D ENABLE_TESTING=NO -D dispatch_DIR=S:/b/libdispatch/cmake/modules -G Ninja -S S:\swift-corelibs-foundation +cmake -B S:\b\foundation -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=S:/b/toolchain/bin/clang-cl.exe -D CMAKE_Swift_COMPILER=S:/b/toolchain/bin/swiftc.exe -D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" -D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" -D ICU_ROOT="S:/Library/icu-67" -D ICU_INCLUDE_DIR=S:/Library/icu-67/usr/include -D LIBXML2_LIBRARY="S:/Library/libxml2-development/usr/lib/libxml2s.lib" -D LIBXML2_INCLUDE_DIR="S:/Library/libxml2-development/usr/include/libxml2" -D ENABLE_TESTING=NO -D dispatch_DIR=S:/b/libdispatch/cmake/modules -G Ninja -S S:\swift-corelibs-foundation ninja -C S:\b\foundation ``` @@ -210,7 +210,7 @@ ninja -C S:\b\xctest check-xctest ## Rebuild Foundation ```cmd -cmake -B S:\b\foundation -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=S:/b/toolchain/bin/clang-cl.exe -D CMAKE_Swift_COMPILER=S:/b/toolchain/bin/swiftc.exe -D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" -D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" -D ICU_ROOT="S:/Library/icu-64" -D LIBXML2_LIBRARY="S:/Library/libxml2-development/usr/lib/libxml2.lib" -D LIBXML2_INCLUDE_DIR="S:/Library/libxml2-development/usr/include" -D ENABLE_TESTING=YES -D dispatch_DIR=S:/b/libdispatch/cmake/modules -D XCTest_DIR=S:/b/xctest/cmake/modules -G Ninja -S S:\swift-corelibs-foundation +cmake -B S:\b\foundation -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=S:/b/toolchain/bin/clang-cl.exe -D CMAKE_Swift_COMPILER=S:/b/toolchain/bin/swiftc.exe -D CURL_LIBRARY="S:/Library/libcurl-development/usr/lib/libcurl.lib" -D CURL_INCLUDE_DIR="S:/Library/libcurl-development/usr/include" -D ICU_ROOT="S:/Library/icu-67" -D LIBXML2_LIBRARY="S:/Library/libxml2-development/usr/lib/libxml2.lib" -D LIBXML2_INCLUDE_DIR="S:/Library/libxml2-development/usr/include" -D ENABLE_TESTING=YES -D dispatch_DIR=S:/b/libdispatch/cmake/modules -D XCTest_DIR=S:/b/xctest/cmake/modules -G Ninja -S S:\swift-corelibs-foundation ninja -C S:\b\foundation ``` diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index d12b61b251394..7467f35798830 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -2668,6 +2668,9 @@ ERROR(enum_non_integer_convertible_raw_type_no_value,none, "expressible by integer or string literal", ()) ERROR(enum_raw_value_not_unique,none, "raw value for enum case is not unique", ()) +ERROR(enum_raw_value_magic_literal,none, + "use of '%0' literal as raw value for enum case is not supported", + (StringRef)) NOTE(enum_raw_value_used_here,none, "raw value previously used here", ()) NOTE(enum_raw_value_incrementing_from_here,none, diff --git a/include/swift/Basic/Dwarf.h b/include/swift/Basic/Dwarf.h index 16e06123f5470..2c6f12dbc7789 100644 --- a/include/swift/Basic/Dwarf.h +++ b/include/swift/Basic/Dwarf.h @@ -23,8 +23,8 @@ namespace swift { /// The DWARF version emitted by the Swift compiler. const unsigned DWARFVersion = 4; - static const char MachOASTSegmentName[] = "__SWIFT"; - static const char MachOASTSectionName[] = "__ast"; + static const char MachOASTSegmentName[] = "__DWARF"; + static const char MachOASTSectionName[] = "__swift_ast"; static const char ELFASTSectionName[] = ".swift_ast"; static const char COFFASTSectionName[] = "swiftast"; static const char WasmASTSectionName[] = ".swift_ast"; diff --git a/include/swift/SIL/OwnershipUtils.h b/include/swift/SIL/OwnershipUtils.h index c2d6b45336597..4f2a36d7282aa 100644 --- a/include/swift/SIL/OwnershipUtils.h +++ b/include/swift/SIL/OwnershipUtils.h @@ -66,18 +66,20 @@ bool isOwnedForwardingInstruction(SILInstruction *inst); /// previous terminator. bool isOwnedForwardingValue(SILValue value); -struct BorrowingOperandKind { - enum Kind { +class BorrowingOperandKind { +public: + enum Kind : uint8_t { BeginBorrow, BeginApply, Branch, }; +private: Kind value; +public: BorrowingOperandKind(Kind newValue) : value(newValue) {} - BorrowingOperandKind(const BorrowingOperandKind &other) - : value(other.value) {} + operator Kind() const { return value; } static Optional get(SILInstructionKind kind) { @@ -207,15 +209,20 @@ struct BorrowingOperand { llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const BorrowingOperand &operand); -struct BorrowedValueKind { +class BorrowedValueKind { +public: /// Enum we use for exhaustive pattern matching over borrow scope introducers. - enum Kind { + enum Kind : uint8_t { LoadBorrow, BeginBorrow, SILFunctionArgument, Phi, }; +private: + Kind value; + +public: static Optional get(SILValue value) { if (value.getOwnershipKind() != ValueOwnershipKind::Guaranteed) return None; @@ -240,10 +247,8 @@ struct BorrowedValueKind { } } - Kind value; - BorrowedValueKind(Kind newValue) : value(newValue) {} - BorrowedValueKind(const BorrowedValueKind &other) : value(other.value) {} + operator Kind() const { return value; } /// Is this a borrow scope that begins and ends within the same function and @@ -383,18 +388,20 @@ bool getAllBorrowIntroducingValues(SILValue value, /// introducer, then we return a .some(BorrowScopeIntroducingValue). Optional getSingleBorrowIntroducingValue(SILValue inputValue); -struct InteriorPointerOperandKind { +class InteriorPointerOperandKind { +public: enum Kind : uint8_t { RefElementAddr, RefTailAddr, OpenExistentialBox, }; +private: Kind value; +public: InteriorPointerOperandKind(Kind newValue) : value(newValue) {} - InteriorPointerOperandKind(const InteriorPointerOperandKind &other) - : value(other.value) {} + operator Kind() const { return value; } static Optional get(Operand *use) { @@ -467,8 +474,9 @@ struct InteriorPointerOperand { : operand(op), kind(kind) {} }; -struct OwnedValueIntroducerKind { - enum Kind { +class OwnedValueIntroducerKind { +public: + enum Kind : uint8_t { /// An owned value that is a result of an Apply. Apply, @@ -519,6 +527,10 @@ struct OwnedValueIntroducerKind { AllocRefInit, }; +private: + Kind value; + +public: static Optional get(SILValue value) { if (value.getOwnershipKind() != ValueOwnershipKind::Owned) return None; @@ -569,11 +581,8 @@ struct OwnedValueIntroducerKind { llvm_unreachable("Default should have caught this"); } - Kind value; - OwnedValueIntroducerKind(Kind newValue) : value(newValue) {} - OwnedValueIntroducerKind(const OwnedValueIntroducerKind &other) - : value(other.value) {} + operator Kind() const { return value; } void print(llvm::raw_ostream &os) const; diff --git a/include/swift/SIL/SILModule.h b/include/swift/SIL/SILModule.h index 4c97abd5751f2..a5c38959ad889 100644 --- a/include/swift/SIL/SILModule.h +++ b/include/swift/SIL/SILModule.h @@ -595,7 +595,7 @@ class SILModule { bool deserializeLazily=true); /// Look up the VTable mapped to the given ClassDecl. Returns null on failure. - SILVTable *lookUpVTable(const ClassDecl *C); + SILVTable *lookUpVTable(const ClassDecl *C, bool deserializeLazily = true); /// Attempt to lookup the function corresponding to \p Member in the class /// hierarchy of \p Class. diff --git a/include/swift/SIL/SILVTable.h b/include/swift/SIL/SILVTable.h index 405063e70cd01..cd9f9c0a87c4c 100644 --- a/include/swift/SIL/SILVTable.h +++ b/include/swift/SIL/SILVTable.h @@ -49,13 +49,12 @@ class SILVTableEntry { /// The function which implements the method for the class and the entry kind. llvm::PointerIntPair ImplAndKind; + bool IsNonOverridden; + public: enum Kind : uint8_t { /// The vtable entry is for a method defined directly in this class. Normal, - /// The vtable entry is for a method defined directly in this class, and is - /// never overridden by subclasses. - NormalNonOverridden, /// The vtable entry is inherited from the superclass. Inherited, /// The vtable entry is inherited from the superclass, and overridden @@ -67,14 +66,19 @@ class SILVTableEntry { SILVTableEntry() : ImplAndKind(nullptr, Kind::Normal) {} - SILVTableEntry(SILDeclRef Method, SILFunction *Implementation, Kind TheKind) - : Method(Method), ImplAndKind(Implementation, TheKind) {} + SILVTableEntry(SILDeclRef Method, SILFunction *Implementation, Kind TheKind, + bool NonOverridden) + : Method(Method), ImplAndKind(Implementation, TheKind), + IsNonOverridden(NonOverridden) {} SILDeclRef getMethod() const { return Method; } Kind getKind() const { return Kind(ImplAndKind.getInt()); } void setKind(Kind kind) { ImplAndKind.setInt(kind); } + bool isNonOverridden() const { return IsNonOverridden; } + void setNonOverridden(bool value) { IsNonOverridden = value; } + SILFunction *getImplementation() const { return ImplAndKind.getPointer(); } }; diff --git a/lib/AST/NameLookup.cpp b/lib/AST/NameLookup.cpp index 156c511cb590e..626715f458227 100644 --- a/lib/AST/NameLookup.cpp +++ b/lib/AST/NameLookup.cpp @@ -1331,6 +1331,12 @@ DirectLookupRequest::evaluate(Evaluator &evaluator, decl->prepareLookupTable(); + // If we're allowed to load extensions, call prepareExtensions to ensure we + // properly invalidate the lazily-complete cache for any extensions brought in + // by modules loaded after-the-fact. This can happen with the LLDB REPL. + if (!disableAdditionalExtensionLoading) + decl->prepareExtensions(); + auto &Table = *decl->LookupTable; if (!useNamedLazyMemberLoading) { // Make sure we have the complete list of members (in this nominal and in diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 192a85ff30e6c..ce805c53898f1 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -2208,6 +2208,16 @@ getObjCObjectRepresentable(Type type, const DeclContext *dc) { static std::pair getForeignRepresentable(Type type, ForeignLanguage language, const DeclContext *dc) { + // Local function that simply produces a failing result. + auto failure = []() -> std::pair { + return { ForeignRepresentableKind::None, nullptr }; + }; + + // If type has an error let's fail early. + if (type->hasError()) + return failure(); + // Look through one level of optional type, but remember that we did. bool wasOptional = false; if (auto valueType = type->getOptionalObjectType()) { @@ -2222,12 +2232,6 @@ getForeignRepresentable(Type type, ForeignLanguage language, return { representable, nullptr }; } - // Local function that simply produces a failing result. - auto failure = []() -> std::pair { - return { ForeignRepresentableKind::None, nullptr }; - }; - // Function types. if (auto functionType = type->getAs()) { // Cannot handle throwing functions. diff --git a/lib/Basic/CMakeLists.txt b/lib/Basic/CMakeLists.txt index c1ed3d503bebc..47bee7793ac61 100644 --- a/lib/Basic/CMakeLists.txt +++ b/lib/Basic/CMakeLists.txt @@ -34,7 +34,6 @@ function(generate_revision_inc revision_inc_var name dir) endfunction() generate_revision_inc(llvm_revision_inc LLVM "${LLVM_MAIN_SRC_DIR}") -generate_revision_inc(clang_revision_inc Clang "${CLANG_MAIN_SRC_DIR}") generate_revision_inc(swift_revision_inc Swift "${SWIFT_SOURCE_DIR}") add_swift_host_library(swiftBasic STATIC diff --git a/lib/Basic/Version.cpp b/lib/Basic/Version.cpp index f15f4d63be0bb..37ccda1de0bce 100644 --- a/lib/Basic/Version.cpp +++ b/lib/Basic/Version.cpp @@ -45,34 +45,25 @@ #endif #include "LLVMRevision.inc" -#include "ClangRevision.inc" #include "SwiftRevision.inc" namespace swift { namespace version { -/// Print a string of the form "LLVM xxxxx, Clang yyyyy, Swift zzzzz", -/// where each placeholder is the revision for the associated repository. +/// Print a string of the form "LLVM xxxxx, Swift zzzzz", where each placeholder +/// is the revision for the associated repository. static void printFullRevisionString(raw_ostream &out) { - // Arbitrarily truncate to 10 characters. This should be enough to unique - // Git hashes for the time being, and certainly enough for SVN revisions, - // while keeping the version string from being ridiculously long. + // Arbitrarily truncate to 15 characters. This should be enough to unique Git + // hashes while keeping the REPL version string from overflowing 80 columns. #if defined(LLVM_REVISION) - out << "LLVM " << StringRef(LLVM_REVISION).slice(0, 10); -# if defined(CLANG_REVISION) || defined(SWIFT_REVISION) - out << ", "; -# endif -#endif - -#if defined(CLANG_REVISION) - out << "Clang " << StringRef(CLANG_REVISION).slice(0, 10); + out << "LLVM " << StringRef(LLVM_REVISION).slice(0, 15); # if defined(SWIFT_REVISION) out << ", "; # endif #endif #if defined(SWIFT_REVISION) - out << "Swift " << StringRef(SWIFT_REVISION).slice(0, 10); + out << "Swift " << StringRef(SWIFT_REVISION).slice(0, 15); #endif } @@ -424,8 +415,7 @@ std::string getSwiftFullVersion(Version effectiveVersion) { OS << " clang-" CLANG_COMPILER_VERSION; #endif OS << ")"; -#elif defined(LLVM_REVISION) || defined(CLANG_REVISION) || \ - defined(SWIFT_REVISION) +#elif defined(LLVM_REVISION) || defined(SWIFT_REVISION) OS << " ("; printFullRevisionString(OS); OS << ")"; diff --git a/lib/ClangImporter/ImportName.cpp b/lib/ClangImporter/ImportName.cpp index 23d49a3be21ea..964f8195a40a4 100644 --- a/lib/ClangImporter/ImportName.cpp +++ b/lib/ClangImporter/ImportName.cpp @@ -1423,6 +1423,9 @@ ImportedName NameImporter::importNameImpl(const clang::NamedDecl *D, case clang::OverloadedOperatorKind::OO_Minus: case clang::OverloadedOperatorKind::OO_Star: case clang::OverloadedOperatorKind::OO_Slash: + case clang::OverloadedOperatorKind::OO_Percent: + case clang::OverloadedOperatorKind::OO_Amp: + case clang::OverloadedOperatorKind::OO_Pipe: case clang::OverloadedOperatorKind::OO_LessLess: case clang::OverloadedOperatorKind::OO_GreaterGreater: case clang::OverloadedOperatorKind::OO_AmpAmp: diff --git a/lib/IRGen/ClassMetadataVisitor.h b/lib/IRGen/ClassMetadataVisitor.h index a7453f8dad37c..168f7cc0eea64 100644 --- a/lib/IRGen/ClassMetadataVisitor.h +++ b/lib/IRGen/ClassMetadataVisitor.h @@ -21,6 +21,8 @@ #include "swift/AST/ASTContext.h" #include "swift/AST/SubstitutionMap.h" #include "swift/SIL/SILDeclRef.h" +#include "swift/SIL/SILModule.h" +#include "swift/SIL/SILVTable.h" #include "swift/SIL/SILVTableVisitor.h" #include "IRGen.h" #include "NominalMetadataVisitor.h" @@ -30,6 +32,15 @@ namespace irgen { class IRGenModule; +/// Returns true if the given SILVTable entry needs to be reified as a runtime +/// vtable entry. +/// +/// Methods that have no overrides, and no ABI constraints that require a +/// vtable to be present, can be left out of the runtime vtable for classes. +bool methodRequiresReifiedVTableEntry(IRGenModule &IGM, + const SILVTable *vtable, + SILDeclRef method); + /// A CRTP class for laying out class metadata. Note that this does /// *not* handle the metadata template stuff. template class ClassMetadataVisitor @@ -43,9 +54,13 @@ template class ClassMetadataVisitor /// The most-derived class. ClassDecl *const Target; + + /// SILVTable entry for the class. + const SILVTable *VTable; ClassMetadataVisitor(IRGenModule &IGM, ClassDecl *target) - : super(IGM), Target(target) {} + : super(IGM), Target(target), + VTable(IGM.getSILModule().lookUpVTable(target, /*deserialize*/ false)) {} public: void layout() { @@ -152,8 +167,15 @@ template class ClassMetadataVisitor // Add vtable entries. asImpl().addVTableEntries(theClass); } - -private: + + friend SILVTableVisitor; + void addMethod(SILDeclRef declRef) { + // Does this method require a reified runtime vtable entry? + if (methodRequiresReifiedVTableEntry(IGM, VTable, declRef)) { + asImpl().addReifiedVTableEntry(declRef); + } + } + void addFieldEntries(Decl *field) { if (auto var = dyn_cast(field)) { asImpl().addFieldOffset(var); @@ -194,7 +216,7 @@ class ClassMetadataScanner : public ClassMetadataVisitor { void addClassAddressPoint() { addInt32(); } void addClassCacheData() { addPointer(); addPointer(); } void addClassDataPointer() { addPointer(); } - void addMethod(SILDeclRef declRef) { + void addReifiedVTableEntry(SILDeclRef declRef) { addPointer(); } void addMethodOverride(SILDeclRef baseRef, SILDeclRef declRef) {} diff --git a/lib/IRGen/GenDecl.cpp b/lib/IRGen/GenDecl.cpp index d50173195d07e..f79cec8c594e2 100644 --- a/lib/IRGen/GenDecl.cpp +++ b/lib/IRGen/GenDecl.cpp @@ -1105,8 +1105,11 @@ void IRGenerator::emitGlobalTopLevel(llvm::StringSet<> *linkerDirectives) { IGM->emitSILDifferentiabilityWitness(&dw); } - // Emit code coverage mapping data. - PrimaryIGM->emitCoverageMapping(); + // Emit code coverage mapping data for all modules + for (auto Iter : *this) { + IRGenModule *IGM = Iter.second; + IGM->emitCoverageMapping(); + } for (auto Iter : *this) { IRGenModule *IGM = Iter.second; diff --git a/lib/IRGen/GenMeta.cpp b/lib/IRGen/GenMeta.cpp index 0487fe65f871c..827f5991da022 100644 --- a/lib/IRGen/GenMeta.cpp +++ b/lib/IRGen/GenMeta.cpp @@ -1437,7 +1437,13 @@ namespace { } void addMethod(SILDeclRef fn) { - VTableEntries.push_back(fn); + if (methodRequiresReifiedVTableEntry(IGM, VTable, fn)) { + VTableEntries.push_back(fn); + } else if (getType()->getEffectiveAccess() >= AccessLevel::Public) { + // Emit a stub method descriptor and lookup function for nonoverridden + // methods so that resilient code sequences can still use them. + emitNonoverriddenMethod(fn); + } } void addMethodOverride(SILDeclRef baseRef, SILDeclRef declRef) { @@ -1521,9 +1527,6 @@ namespace { } void addVTable() { - if (VTableEntries.empty()) - return; - LLVM_DEBUG( llvm::dbgs() << "VTable entries for " << getType()->getName() << ":\n"; for (auto entry : VTableEntries) { @@ -1533,6 +1536,9 @@ namespace { } ); + if (VTableEntries.empty()) + return; + // Only emit a method lookup function if the class is resilient // and has a non-empty vtable. if (IGM.hasResilientMetadata(getType(), ResilienceExpansion::Minimal)) @@ -1595,8 +1601,25 @@ namespace { IGM.emitDispatchThunk(fn); } } + + void emitNonoverriddenMethod(SILDeclRef fn) { + // TODO: Emit a freestanding method descriptor structure, and a method + // lookup function, to present the ABI of an overridable method even + // though the method has no real overrides currently. + } void addOverrideTable() { + LLVM_DEBUG( + llvm::dbgs() << "Override Table entries for " << getType()->getName() << ":\n"; + for (auto entry : OverrideTableEntries) { + llvm::dbgs() << " "; + entry.first.print(llvm::dbgs()); + llvm::dbgs() << " -> "; + entry.second.print(llvm::dbgs()); + llvm::dbgs() << '\n'; + } + ); + if (OverrideTableEntries.empty()) return; @@ -2702,12 +2725,12 @@ namespace { using super::asImpl; using super::IGM; using super::Target; + using super::VTable; ConstantStructBuilder &B; const ClassLayout &FieldLayout; const ClassMetadataLayout &MetadataLayout; - const SILVTable *VTable; Size AddressPoint; @@ -2717,8 +2740,7 @@ namespace { const ClassLayout &fieldLayout) : super(IGM, theClass), B(builder), FieldLayout(fieldLayout), - MetadataLayout(IGM.getClassMetadataLayout(theClass)), - VTable(IGM.getSILModule().lookUpVTable(theClass)) {} + MetadataLayout(IGM.getClassMetadataLayout(theClass)) {} public: SILType getLoweredType() { @@ -2854,7 +2876,7 @@ namespace { PointerAuthEntity::Special::HeapDestructor); } else { // In case the optimizer removed the function. See comment in - // addMethod(). + // addReifiedVTableEntry(). B.addNullPointer(IGM.FunctionPtrTy); } } @@ -2973,7 +2995,7 @@ namespace { B.add(data); } - void addMethod(SILDeclRef fn) { + void addReifiedVTableEntry(SILDeclRef fn) { // Find the vtable entry. assert(VTable && "no vtable?!"); auto entry = VTable->getEntry(IGM.getSILModule(), fn); @@ -5075,3 +5097,33 @@ void IRGenModule::emitOpaqueTypeDecl(OpaqueTypeDecl *D) { // Emit the opaque type descriptor. OpaqueTypeDescriptorBuilder(*this, D).emit(); } + +bool irgen::methodRequiresReifiedVTableEntry(IRGenModule &IGM, + const SILVTable *vtable, + SILDeclRef method) { + auto &M = IGM.getSILModule(); + auto entry = vtable->getEntry(IGM.getSILModule(), method); + if (!entry) { + return true; + } + + // We may be able to elide the vtable entry, ABI permitting, if it's not + // overridden. + if (!entry->isNonOverridden()) { + return true; + } + + // Does the ABI require a vtable entry to exist? If the class is public, + // and it's either marked fragile or part of a non-resilient module, then + // other modules will directly address vtable offsets and we can't remove + // vtable entries. + if (vtable->getClass()->getEffectiveAccess() >= AccessLevel::Public) { + // TODO: Check whether we use a resilient ABI to access this + // class's methods. We can drop unnecessary vtable entries if we do; + // otherwise fixed vtable offsets are part of the ABI. + return true; + } + + // Otherwise, we can leave this method out of the runtime vtable. + return false; +} diff --git a/lib/IRGen/GenProto.cpp b/lib/IRGen/GenProto.cpp index 2cb7ba801893d..3e7d81c2ca5fd 100644 --- a/lib/IRGen/GenProto.cpp +++ b/lib/IRGen/GenProto.cpp @@ -2749,12 +2749,10 @@ static void addAbstractConditionalRequirements( auto *proto = req.getSecondType()->castTo()->getDecl(); auto ty = req.getFirstType()->getCanonicalType(); - if (!isa(ty)) + auto archetype = dyn_cast(ty); + if (!archetype) continue; - auto conformance = subMap.lookupConformance(ty, proto); - if (!conformance.isAbstract()) - continue; - requirements.insert({ty, conformance.getAbstract()}); + requirements.insert({ty, proto}); } // Recursively add conditional requirements. for (auto &conf : subMap.getConformances()) { diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 21a400c8f3213..ca88f2efaccff 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -1364,6 +1364,10 @@ swift::createSwiftModuleObjectFile(SILModule &SILMod, StringRef Buffer, assert(!Ctx.hadError()); IRGenOptions Opts; + // This tool doesn't pass the necessary runtime library path to + // TypeConverter, because this feature isn't needed. + Opts.DisableLegacyTypeInfo = true; + Opts.OutputKind = IRGenOutputKind::ObjectFile; IRGenerator irgen(Opts, SILMod); diff --git a/lib/IRGen/MetadataLayout.cpp b/lib/IRGen/MetadataLayout.cpp index 274f3e6c616a4..f8cbaf4b57948 100644 --- a/lib/IRGen/MetadataLayout.cpp +++ b/lib/IRGen/MetadataLayout.cpp @@ -330,12 +330,12 @@ ClassMetadataLayout::ClassMetadataLayout(IRGenModule &IGM, ClassDecl *decl) super::addGenericArgument(requirement, forClass); } - void addMethod(SILDeclRef fn) { + void addReifiedVTableEntry(SILDeclRef fn) { if (fn.getDecl()->getDeclContext() == Target) { ++Layout.NumImmediateMembers; Layout.MethodInfos.try_emplace(fn, getNextOffset()); } - super::addMethod(fn); + super::addReifiedVTableEntry(fn); } void noteStartOfFieldOffsets(ClassDecl *forClass) { diff --git a/lib/SIL/IR/SILGlobalVariable.cpp b/lib/SIL/IR/SILGlobalVariable.cpp index aabc172937023..4a6b02cd42bd1 100644 --- a/lib/SIL/IR/SILGlobalVariable.cpp +++ b/lib/SIL/IR/SILGlobalVariable.cpp @@ -136,6 +136,8 @@ bool SILGlobalVariable::isValidStaticInitializerInst(const SILInstruction *I, auto *TE = bi->getSingleUserOfType(); return TE && getOffsetSubtract(TE, M); } + case BuiltinValueKind::OnFastPath: + return true; default: break; } diff --git a/lib/SIL/IR/SILModule.cpp b/lib/SIL/IR/SILModule.cpp index 1c941a1076375..68d8f2a54dd40 100644 --- a/lib/SIL/IR/SILModule.cpp +++ b/lib/SIL/IR/SILModule.cpp @@ -476,7 +476,8 @@ void SILModule::eraseGlobalVariable(SILGlobalVariable *G) { getSILGlobalList().erase(G); } -SILVTable *SILModule::lookUpVTable(const ClassDecl *C) { +SILVTable *SILModule::lookUpVTable(const ClassDecl *C, + bool deserializeLazily) { if (!C) return nullptr; @@ -485,6 +486,9 @@ SILVTable *SILModule::lookUpVTable(const ClassDecl *C) { if (R != VTableMap.end()) return R->second; + if (!deserializeLazily) + return nullptr; + // If that fails, try to deserialize it. If that fails, return nullptr. SILVTable *Vtbl = getSILLoader()->lookupVTable(C); if (!Vtbl) diff --git a/lib/SIL/IR/SILPrinter.cpp b/lib/SIL/IR/SILPrinter.cpp index a4fe67f32bc65..a0613879a627c 100644 --- a/lib/SIL/IR/SILPrinter.cpp +++ b/lib/SIL/IR/SILPrinter.cpp @@ -3131,9 +3131,6 @@ void SILVTable::print(llvm::raw_ostream &OS, bool Verbose) const { switch (entry.getKind()) { case SILVTable::Entry::Kind::Normal: break; - case SILVTable::Entry::Kind::NormalNonOverridden: - OS << " [nonoverridden]"; - break; case SILVTable::Entry::Kind::Inherited: OS << " [inherited]"; break; @@ -3141,6 +3138,10 @@ void SILVTable::print(llvm::raw_ostream &OS, bool Verbose) const { OS << " [override]"; break; } + if (entry.isNonOverridden()) { + OS << " [nonoverridden]"; + } + OS << "\t// " << demangleSymbol(entry.getImplementation()->getName()); OS << "\n"; } diff --git a/lib/SIL/Parser/ParseSIL.cpp b/lib/SIL/Parser/ParseSIL.cpp index 90603b27bfbf3..90a8545a159d5 100644 --- a/lib/SIL/Parser/ParseSIL.cpp +++ b/lib/SIL/Parser/ParseSIL.cpp @@ -1340,6 +1340,7 @@ static Optional getAccessorKind(StringRef ident) { /// sil-decl-subref ::= '!' sil-decl-subref-part ('.' sil-decl-lang)? /// ('.' sil-decl-autodiff)? /// sil-decl-subref ::= '!' sil-decl-lang +/// sil-decl-subref ::= '!' sil-decl-autodiff /// sil-decl-subref-part ::= 'getter' /// sil-decl-subref-part ::= 'setter' /// sil-decl-subref-part ::= 'allocator' @@ -6083,7 +6084,8 @@ bool SILParserState::parseSILVTable(Parser &P) { } auto Kind = SILVTable::Entry::Kind::Normal; - if (P.Tok.is(tok::l_square)) { + bool NonOverridden = false; + while (P.Tok.is(tok::l_square)) { P.consumeToken(tok::l_square); if (P.Tok.isNot(tok::identifier)) { P.diagnose(P.Tok.getLoc(), diag::sil_vtable_bad_entry_kind); @@ -6098,7 +6100,7 @@ bool SILParserState::parseSILVTable(Parser &P) { Kind = SILVTable::Entry::Kind::Inherited; } else if (P.Tok.getText() == "nonoverridden") { P.consumeToken(); - Kind = SILVTable::Entry::Kind::NormalNonOverridden; + NonOverridden = true; } else { P.diagnose(P.Tok.getLoc(), diag::sil_vtable_bad_entry_kind); return true; @@ -6108,7 +6110,7 @@ bool SILParserState::parseSILVTable(Parser &P) { return true; } - vtableEntries.emplace_back(Ref, Func, Kind); + vtableEntries.emplace_back(Ref, Func, Kind, NonOverridden); } while (P.Tok.isNot(tok::r_brace) && P.Tok.isNot(tok::eof)); } diff --git a/lib/SIL/Verifier/SILVerifier.cpp b/lib/SIL/Verifier/SILVerifier.cpp index 24e601367aa43..84e74fb9db4ee 100644 --- a/lib/SIL/Verifier/SILVerifier.cpp +++ b/lib/SIL/Verifier/SILVerifier.cpp @@ -5425,7 +5425,6 @@ void SILVTable::verify(const SILModule &M) const { bool validKind; switch (entry.getKind()) { case Entry::Normal: - case Entry::NormalNonOverridden: validKind = true; break; @@ -5450,21 +5449,26 @@ void SILVTable::verify(const SILModule &M) const { switch (entry.getKind()) { case Entry::Normal: - case Entry::NormalNonOverridden: assert(!superEntry && "non-root vtable entry must be inherited or override"); break; case Entry::Inherited: + if (!superEntry) + break; + + assert(entry.isNonOverridden() == superEntry->isNonOverridden() + && "inherited vtable entry must share overridden-ness of superclass entry"); break; case Entry::Override: + assert(!entry.isNonOverridden() + && "override entry can't claim to be nonoverridden"); if (!superEntry) break; // The superclass entry must not prohibit overrides. - assert( - superEntry->getKind() != Entry::NormalNonOverridden && - "vtable entry overrides an entry that claims to have no overrides"); + assert(!superEntry->isNonOverridden() + && "vtable entry overrides an entry that claims to have no overrides"); // TODO: Check the root vtable entry for the method too. break; } diff --git a/lib/SILGen/SILGenType.cpp b/lib/SILGen/SILGenType.cpp index b4356c89bb066..83f2de20c78f3 100644 --- a/lib/SILGen/SILGenType.cpp +++ b/lib/SILGen/SILGenType.cpp @@ -104,7 +104,7 @@ SILGenModule::emitVTableMethod(ClassDecl *theClass, // As a fast path, if there is no override, definitely no thunk is necessary. if (derived == base) - return SILVTable::Entry(base, implFn, implKind); + return SILVTable::Entry(base, implFn, implKind, false); // If the base method is less visible than the derived method, we need // a thunk. @@ -151,7 +151,7 @@ SILGenModule::emitVTableMethod(ClassDecl *theClass, if (doesNotHaveGenericRequirementDifference && !baseLessVisibleThanDerived && compatibleCallingConvention) - return SILVTable::Entry(base, implFn, implKind); + return SILVTable::Entry(base, implFn, implKind, false); // Generate the thunk name. std::string name; @@ -182,7 +182,7 @@ SILGenModule::emitVTableMethod(ClassDecl *theClass, // If we already emitted this thunk, reuse it. if (auto existingThunk = M.lookUpFunction(name)) - return SILVTable::Entry(base, existingThunk, implKind); + return SILVTable::Entry(base, existingThunk, implKind, false); GenericEnvironment *genericEnv = nullptr; if (auto genericSig = overrideInfo.FormalType.getOptGenericSignature()) @@ -207,7 +207,7 @@ SILGenModule::emitVTableMethod(ClassDecl *theClass, baseLessVisibleThanDerived); emitLazyConformancesForFunction(thunk); - return SILVTable::Entry(base, thunk, implKind); + return SILVTable::Entry(base, thunk, implKind, false); } bool SILGenModule::requiresObjCMethodEntryPoint(FuncDecl *method) { @@ -292,14 +292,16 @@ class SILGenVTable : public SILVTableVisitor { SILDeclRef dtorRef(dtor, SILDeclRef::Kind::Deallocator); auto *dtorFn = SGM.getFunction(dtorRef, NotForDefinition); vtableEntries.emplace_back(dtorRef, dtorFn, - SILVTable::Entry::Kind::Normal); + SILVTable::Entry::Kind::Normal, + false); } if (SGM.requiresIVarDestroyer(theClass)) { SILDeclRef dtorRef(theClass, SILDeclRef::Kind::IVarDestroyer); auto *dtorFn = SGM.getFunction(dtorRef, NotForDefinition); vtableEntries.emplace_back(dtorRef, dtorFn, - SILVTable::Entry::Kind::Normal); + SILVTable::Entry::Kind::Normal, + false); } IsSerialized_t serialized = IsNotSerialized; diff --git a/lib/SILOptimizer/Transforms/PruneVTables.cpp b/lib/SILOptimizer/Transforms/PruneVTables.cpp index 6651390abc252..c918e88542e69 100644 --- a/lib/SILOptimizer/Transforms/PruneVTables.cpp +++ b/lib/SILOptimizer/Transforms/PruneVTables.cpp @@ -27,9 +27,18 @@ class PruneVTables : public SILModuleTransform { void runOnVTable(SILModule *M, SILVTable *vtable) { for (auto &entry : vtable->getMutableEntries()) { - // We don't need to worry about entries that are inherited, overridden, + + // We don't need to worry about entries that are overridden, // or have already been found to have no overrides. - if (entry.getKind() != SILVTable::Entry::Normal) { + if (entry.isNonOverridden()) + continue; + + switch (entry.getKind()) { + case SILVTable::Entry::Normal: + case SILVTable::Entry::Inherited: + break; + + case SILVTable::Entry::Override: continue; } @@ -52,8 +61,7 @@ class PruneVTables : public SILModuleTransform { if (methodDecl->isOverridden()) continue; } - - entry.setKind(SILVTable::Entry::NormalNonOverridden); + entry.setNonOverridden(true); } } diff --git a/lib/Sema/CSSimplify.cpp b/lib/Sema/CSSimplify.cpp index bea9edfe9a55b..8330741968c3e 100644 --- a/lib/Sema/CSSimplify.cpp +++ b/lib/Sema/CSSimplify.cpp @@ -1350,20 +1350,53 @@ ConstraintSystem::matchTupleTypes(TupleType *tuple1, TupleType *tuple2, return getTypeMatchSuccess(); } +// Determine whether conversion is allowed between two function types +// based on their representations. +static bool +isConversionAllowedBetween(FunctionTypeRepresentation rep1, + FunctionTypeRepresentation rep2) { + auto isThin = [](FunctionTypeRepresentation rep) { + return rep == FunctionTypeRepresentation::CFunctionPointer || + rep == FunctionTypeRepresentation::Thin; + }; + + // Allowing "thin" (c, thin) to "thin" conventions + if (isThin(rep1) && isThin(rep2)) + return true; + + // Allowing all to "thick" (swift, block) conventions + // "thin" (c, thin) to "thick" or "thick" to "thick" + if (rep2 == FunctionTypeRepresentation::Swift || + rep2 == FunctionTypeRepresentation::Block) + return true; + + return rep1 == rep2; +} + // Returns 'false' (i.e. no error) if it is legal to match functions with the // corresponding function type representations and the given match kind. static bool matchFunctionRepresentations(FunctionTypeRepresentation rep1, FunctionTypeRepresentation rep2, - ConstraintKind kind) { + ConstraintKind kind, + ConstraintLocatorBuilder locator) { switch (kind) { case ConstraintKind::Bind: case ConstraintKind::BindParam: case ConstraintKind::BindToPointerType: case ConstraintKind::Equal: return rep1 != rep2; + + case ConstraintKind::Subtype: { + auto last = locator.last(); + if (!(last && last->is())) + return false; + + // Inverting the result because matchFunctionRepresentations + // returns false in conversions are allowed. + return !isConversionAllowedBetween(rep1, rep2); + } case ConstraintKind::OpaqueUnderlyingType: - case ConstraintKind::Subtype: case ConstraintKind::Conversion: case ConstraintKind::BridgingConversion: case ConstraintKind::ArgumentConversion: @@ -1658,7 +1691,7 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2, if (matchFunctionRepresentations(func1->getExtInfo().getRepresentation(), func2->getExtInfo().getRepresentation(), - kind)) { + kind, locator)) { return getTypeMatchFailure(locator); } diff --git a/lib/Sema/ConstraintSystem.cpp b/lib/Sema/ConstraintSystem.cpp index e4f8310ed326d..1333ed4d09e3a 100644 --- a/lib/Sema/ConstraintSystem.cpp +++ b/lib/Sema/ConstraintSystem.cpp @@ -3451,6 +3451,13 @@ void constraints::simplifyLocator(ASTNode &anchor, if (auto subscriptExpr = getAsExpr(anchor)) { anchor = subscriptExpr->getIndex(); path = path.slice(1); + + // TODO: It would be better if the index expression was always wrapped + // in a ParenExpr (if there is no label). + if (!(isExpr(anchor) || isExpr(anchor)) && + !path.empty() && path[0].is()) { + path = path.slice(1); + } continue; } diff --git a/lib/Sema/ConstraintSystem.h b/lib/Sema/ConstraintSystem.h index 080f06cd2348a..7f1e6be9f8079 100644 --- a/lib/Sema/ConstraintSystem.h +++ b/lib/Sema/ConstraintSystem.h @@ -1016,7 +1016,7 @@ class Solution { llvm::SmallPtrSet DefaultedConstraints; /// The node -> type mappings introduced by this solution. - llvm::MapVector nodeTypes; + llvm::DenseMap nodeTypes; /// Contextual types introduced by this solution. std::vector> contextualTypes; diff --git a/lib/Sema/TypeCheckDecl.cpp b/lib/Sema/TypeCheckDecl.cpp index 333583258b1b6..f94d7a08bc4e2 100644 --- a/lib/Sema/TypeCheckDecl.cpp +++ b/lib/Sema/TypeCheckDecl.cpp @@ -1082,6 +1082,21 @@ EnumRawValuesRequest::evaluate(Evaluator &eval, EnumDecl *ED, if (ED->LazySemanticInfo.hasFixedRawValues()) continue; + // Using magic literals like #file as raw value is not supported right now. + // TODO: We could potentially support #file, #function, #line and #column. + auto &Diags = ED->getASTContext().Diags; + SourceLoc diagLoc = uncheckedRawValueOf(elt)->isImplicit() + ? elt->getLoc() + : uncheckedRawValueOf(elt)->getLoc(); + if (auto magicLiteralExpr = + dyn_cast(prevValue)) { + auto kindString = + magicLiteralExpr->getKindString(magicLiteralExpr->getKind()); + Diags.diagnose(diagLoc, diag::enum_raw_value_magic_literal, kindString); + elt->setInvalid(); + continue; + } + // Check that the raw value is unique. RawValueKey key{prevValue}; RawValueSource source{elt, lastExplicitValueElt}; @@ -1091,9 +1106,6 @@ EnumRawValuesRequest::evaluate(Evaluator &eval, EnumDecl *ED, continue; // Diagnose the duplicate value. - auto &Diags = ED->getASTContext().Diags; - SourceLoc diagLoc = uncheckedRawValueOf(elt)->isImplicit() - ? elt->getLoc() : uncheckedRawValueOf(elt)->getLoc(); Diags.diagnose(diagLoc, diag::enum_raw_value_not_unique); assert(lastExplicitValueElt && "should not be able to have non-unique raw values when " diff --git a/lib/Sema/TypeCheckType.cpp b/lib/Sema/TypeCheckType.cpp index 6c6a1006cb0d5..6702c3b463c3d 100644 --- a/lib/Sema/TypeCheckType.cpp +++ b/lib/Sema/TypeCheckType.cpp @@ -2675,6 +2675,10 @@ Type TypeResolver::resolveASTFunctionType( } auto fnTy = FunctionType::get(params, outputTy, extInfo); + + if (fnTy->hasError()) + return fnTy; + // If the type is a block or C function pointer, it must be representable in // ObjC. switch (representation) { diff --git a/lib/Serialization/DeserializeSIL.cpp b/lib/Serialization/DeserializeSIL.cpp index 3d89dad463117..7e9dfeb71a698 100644 --- a/lib/Serialization/DeserializeSIL.cpp +++ b/lib/Serialization/DeserializeSIL.cpp @@ -79,8 +79,6 @@ static Optional fromStableVTableEntryKind(unsigned value) { switch (value) { case SIL_VTABLE_ENTRY_NORMAL: return SILVTable::Entry::Kind::Normal; - case SIL_VTABLE_ENTRY_NORMAL_NON_OVERRIDDEN: - return SILVTable::Entry::Kind::NormalNonOverridden; case SIL_VTABLE_ENTRY_INHERITED: return SILVTable::Entry::Kind::Inherited; case SIL_VTABLE_ENTRY_OVERRIDE: return SILVTable::Entry::Kind::Override; default: return None; @@ -3034,8 +3032,10 @@ SILVTable *SILDeserializer::readVTable(DeclID VId) { "Content of Vtable should be in SIL_VTABLE_ENTRY."); ArrayRef ListOfValues; DeclID NameID; - unsigned RawEntryKind; - VTableEntryLayout::readRecord(scratch, NameID, RawEntryKind, ListOfValues); + unsigned RawEntryKind, IsNonOverridden; + VTableEntryLayout::readRecord(scratch, NameID, + RawEntryKind, IsNonOverridden, + ListOfValues); auto EntryKind = fromStableVTableEntryKind(RawEntryKind); @@ -3043,7 +3043,7 @@ SILVTable *SILDeserializer::readVTable(DeclID VId) { if (Func) { unsigned NextValueIndex = 0; vtableEntries.emplace_back(getSILDeclRef(MF, ListOfValues, NextValueIndex), - Func, EntryKind.getValue()); + Func, EntryKind.getValue(), (bool)IsNonOverridden); } // Fetch the next record. diff --git a/lib/Serialization/ModuleFormat.h b/lib/Serialization/ModuleFormat.h index cef301bc538ca..065150c5d4d3b 100644 --- a/lib/Serialization/ModuleFormat.h +++ b/lib/Serialization/ModuleFormat.h @@ -55,7 +55,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0; /// describe what change you made. The content of this comment isn't important; /// it just ensures a conflict if two people change the module format. /// Don't worry about adhering to the 80-column limit for this line. -const uint16_t SWIFTMODULE_VERSION_MINOR = 559; // Serialization of -implicit-dynamic +const uint16_t SWIFTMODULE_VERSION_MINOR = 560; // SILVTable flag for non-overridden entries /// A standard hash seed used for all string hashes in a serialized module. /// diff --git a/lib/Serialization/SILFormat.h b/lib/Serialization/SILFormat.h index 5cee308de8e30..ec16f5e92b975 100644 --- a/lib/Serialization/SILFormat.h +++ b/lib/Serialization/SILFormat.h @@ -51,7 +51,6 @@ using SILLinkageField = BCFixed<4>; enum SILVTableEntryKindEncoding : uint8_t { SIL_VTABLE_ENTRY_NORMAL, - SIL_VTABLE_ENTRY_NORMAL_NON_OVERRIDDEN, SIL_VTABLE_ENTRY_INHERITED, SIL_VTABLE_ENTRY_OVERRIDE, }; @@ -183,6 +182,7 @@ namespace sil_block { SIL_VTABLE_ENTRY, DeclIDField, // SILFunction name SILVTableEntryKindField, // Kind + BCFixed<1>, // NonOverridden BCArray // SILDeclRef >; diff --git a/lib/Serialization/SerializeSIL.cpp b/lib/Serialization/SerializeSIL.cpp index ce262f5165ef5..aad7fa2b7d3c8 100644 --- a/lib/Serialization/SerializeSIL.cpp +++ b/lib/Serialization/SerializeSIL.cpp @@ -73,8 +73,6 @@ static unsigned toStableSILLinkage(SILLinkage linkage) { static unsigned toStableVTableEntryKind(SILVTable::Entry::Kind kind) { switch (kind) { case SILVTable::Entry::Kind::Normal: return SIL_VTABLE_ENTRY_NORMAL; - case SILVTable::Entry::Kind::NormalNonOverridden: - return SIL_VTABLE_ENTRY_NORMAL_NON_OVERRIDDEN; case SILVTable::Entry::Kind::Inherited: return SIL_VTABLE_ENTRY_INHERITED; case SILVTable::Entry::Kind::Override: return SIL_VTABLE_ENTRY_OVERRIDE; } @@ -2390,7 +2388,9 @@ void SILSerializer::writeSILVTable(const SILVTable &vt) { Out, ScratchRecord, SILAbbrCodes[VTableEntryLayout::Code], // SILFunction name S.addUniquedStringRef(entry.getImplementation()->getName()), - toStableVTableEntryKind(entry.getKind()), ListOfValues); + toStableVTableEntryKind(entry.getKind()), + entry.isNonOverridden(), + ListOfValues); } } diff --git a/stdlib/public/runtime/Metadata.cpp b/stdlib/public/runtime/Metadata.cpp index 4bcb9ef3ac7d9..b632dfc6f811f 100644 --- a/stdlib/public/runtime/Metadata.cpp +++ b/stdlib/public/runtime/Metadata.cpp @@ -4537,8 +4537,8 @@ WitnessTableCacheEntry::allocate( // Find the allocation. void **fullTable = reinterpret_cast(this + 1); - // Zero out the private storage area. - memset(fullTable, 0, privateSizeInWords * sizeof(void*)); + // Zero out the witness table. + memset(fullTable, 0, getWitnessTableSize(conformance)); // Advance the address point; the private storage area is accessed via // negative offsets. diff --git a/test/AutoDiff/compiler_crashers_fixed/sr12493-differentiable-function-extract-subst-function-type.swift b/test/AutoDiff/compiler_crashers_fixed/sr12493-differentiable-function-extract-subst-function-type.swift index 98952bf453ed4..359c1d2ddb845 100644 --- a/test/AutoDiff/compiler_crashers_fixed/sr12493-differentiable-function-extract-subst-function-type.swift +++ b/test/AutoDiff/compiler_crashers_fixed/sr12493-differentiable-function-extract-subst-function-type.swift @@ -3,6 +3,9 @@ // SR-12493: SIL verification error regarding substituted function types and // `differentiable_function_extract` instruction. Occurs only with `-O`. +// FIXME(SR-13021): Disabled due to flakiness on Linux. +// REQUIRES: SR13021 + import _Differentiation func exampleVJP_1(_ x0: Float) -> (Float, (Float) -> (Float)) { diff --git a/test/AutoDiff/compiler_crashers_fixed/sr12650-noderivative-parameter-type-mangling.swift b/test/AutoDiff/compiler_crashers_fixed/sr12650-noderivative-parameter-type-mangling.swift new file mode 100644 index 0000000000000..9258d97c063c0 --- /dev/null +++ b/test/AutoDiff/compiler_crashers_fixed/sr12650-noderivative-parameter-type-mangling.swift @@ -0,0 +1,40 @@ +// RUN: %target-build-swift -g %s + +// SR-12650: IRGenDebugInfo type reconstruction crash because `@noDerivative` +// parameters are not mangled. + +// FIXME(SR-13021): Disabled due to flakiness on Linux. +// REQUIRES: SR13021 + +import _Differentiation +func id(_ x: Float, _ y: Float) -> Float { x } +let transformed: @differentiable (Float, @noDerivative Float) -> Float = id + +// Incorrect reconstructed type for $sS3fIedgyyd_D +// Original type: +// (sil_function_type type=@differentiable @callee_guaranteed (Float, @noDerivative Float) -> Float +// (input=struct_type decl=Swift.(file).Float) +// (input=struct_type decl=Swift.(file).Float) +// (result=struct_type decl=Swift.(file).Float) +// (substitution_map generic_signature=) +// (substitution_map generic_signature=)) +// Reconstructed type: +// (sil_function_type type=@differentiable @callee_guaranteed (Float, Float) -> Float +// (input=struct_type decl=Swift.(file).Float) +// (input=struct_type decl=Swift.(file).Float) +// (result=struct_type decl=Swift.(file).Float) +// (substitution_map generic_signature=) +// (substitution_map generic_signature=)) +// Stack dump: +// ... +// 1. Swift version 5.3-dev (LLVM 803d1b184d, Swift 477af9f90d) +// 2. While evaluating request IRGenSourceFileRequest(IR Generation for file "noderiv.swift") +// 0 swift 0x00000001104c7ae8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 +// 1 swift 0x00000001104c6a68 llvm::sys::RunSignalHandlers() + 248 +// 2 swift 0x00000001104c80dd SignalHandler(int) + 285 +// 3 libsystem_platform.dylib 0x00007fff718335fd _sigtramp + 29 +// 4 libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603338611739168 +// 5 libsystem_c.dylib 0x00007fff71709808 abort + 120 +// 6 swift 0x0000000110604152 (anonymous namespace)::IRGenDebugInfoImpl::getOrCreateType(swift::irgen::DebugTypeInfo) (.cold.20) + 146 +// 7 swift 0x000000010c24ab1e (anonymous namespace)::IRGenDebugInfoImpl::getOrCreateType(swift::irgen::DebugTypeInfo) + 3614 +// 8 swift 0x000000010c245437 swift::irgen::IRGenDebugInfo::emitGlobalVariableDeclaration(llvm::GlobalVariable*, llvm::StringRef, llvm::StringRef, swift::irgen::DebugTypeInfo, bool, bool, llvm::Optional) + 167 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e5eb7ec7db0e5..b29d88e60f575 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -218,7 +218,7 @@ foreach(SDK ${SWIFT_SDKS}) set(validation_test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/../validation-test${VARIANT_SUFFIX}") - if(LibXml2_FOUND) + if(LLVM_ENABLE_LIBXML2) set(SWIFT_HAVE_LIBXML2 TRUE) else() set(SWIFT_HAVE_LIBXML2 FALSE) diff --git a/test/DebugInfo/ASTSection-single.swift b/test/DebugInfo/ASTSection-single.swift new file mode 100644 index 0000000000000..95f1f05578b92 --- /dev/null +++ b/test/DebugInfo/ASTSection-single.swift @@ -0,0 +1,14 @@ +// REQUIRES: executable_test +// REQUIRES: swift_tools_extra + +// Test that a module-wrapped Swift AST section can be parsed. + +// RUN: %empty-directory(%t) + +// RUN: echo "public let a0 = 0" >%t/a0.swift +// RUN: %target-build-swift %t/a0.swift -emit-module -emit-module-path %t/a0.swiftmodule +// RUN: %target-swift-modulewrap %t/a0.swiftmodule -o %t/a0-mod.o + +// RUN: %lldb-moduleimport-test -verbose %t/a0-mod.o | %FileCheck %s +// CHECK: Importing a0... ok! + diff --git a/test/DebugInfo/ASTSection_linker.swift b/test/DebugInfo/ASTSection_linker.swift index 7fbf987b8ad0f..bf49622056913 100644 --- a/test/DebugInfo/ASTSection_linker.swift +++ b/test/DebugInfo/ASTSection_linker.swift @@ -6,7 +6,7 @@ // RUN: %swift-ide-test -test-CompilerInvocation-from-module -source-filename=%t/ASTSection.swiftmodule // Test the inline section mechanism. -// RUN: %target-ld %t/ASTSection.o -sectcreate __SWIFT __ast %t/ASTSection.swiftmodule -o %t/ASTSection.dylib -dylib -lSystem -lobjc +// RUN: %target-ld %t/ASTSection.o -sectcreate __DWARF __swift_ast %t/ASTSection.swiftmodule -o %t/ASTSection.dylib -dylib -lSystem -lobjc // RUN: %lldb-moduleimport-test -verbose %t/ASTSection.dylib | %FileCheck %s // Test the symbol table entry. diff --git a/test/IRGen/partial_apply_forwarder.sil b/test/IRGen/partial_apply_forwarder.sil index 50ead1c5882c4..9c155222a0812 100644 --- a/test/IRGen/partial_apply_forwarder.sil +++ b/test/IRGen/partial_apply_forwarder.sil @@ -255,6 +255,9 @@ protocol MyEquatable { static func isEqual (lhs: Self, rhs: Self) -> Builtin.Int1 } +protocol MyExtended : MyEquatable { + func extended() +} public struct Inner { public init() public init(_ e: Element) @@ -278,7 +281,7 @@ public struct Outermost { sil @$closure : $@convention(method) (Outer, Outer, @thin Outer.Type) -> Builtin.Int1 sil @$closure2 : $@convention(method) (Outermost, Outermost, @thin Outermost.Type) -> Builtin.Int1 -sil @$dont_crash_test_capture_specialized_conditional_conformance : $@convention(thin) (Outer>) -> () { +sil @$dont_crash_test_capture_specialized_conditional_conformance : $@convention(thin) (Outer>) -> () { bb0(%0 : $Outer>): %2 = alloc_stack $Outer> store %0 to %2 : $*Outer> @@ -291,7 +294,24 @@ bb0(%0 : $Outer>): return %15 : $() } -sil @$dont_crash_test_capture_specialized_conditional_conformance_nested : $@convention(thin) (Outer>) -> () { +protocol AssocType { + associatedtype A : MyExtended +} + +sil @$dont_crash_test_capture_specialized_conditional_conformance_associated_type : $@convention(thin) (Outer>) -> () { +bb0(%0 : $Outer>): + %2 = alloc_stack $Outer> + store %0 to %2 : $*Outer> + %4 = metatype $@thin Outer>.Type + %5 = function_ref @$closure : $@convention(method) <τ_0_0 where τ_0_0 : MyEquatable> (Outer<τ_0_0>, Outer<τ_0_0>, @thin Outer<τ_0_0>.Type) -> Builtin.Int1 + %6 = partial_apply [callee_guaranteed] %5>(%4) : $@convention(method) <τ_0_0 where τ_0_0 : MyEquatable> (Outer<τ_0_0>, Outer<τ_0_0>, @thin Outer<τ_0_0>.Type) -> Builtin.Int1 + strong_release %6 : $@callee_guaranteed (Outer>, Outer>) -> Builtin.Int1 + dealloc_stack %2 : $*Outer> + %15 = tuple () + return %15 : $() +} + +sil @$dont_crash_test_capture_specialized_conditional_conformance_nested : $@convention(thin) (Outer>) -> () { bb0(%0 : $Outer>): %4 = metatype $@thin Outermost>>.Type %5 = function_ref @$closure2 : $@convention(method) (Outermost, Outermost, @thin Outermost.Type) -> Builtin.Int1 diff --git a/test/IRGen/vtable_non_overridden.sil b/test/IRGen/vtable_non_overridden.sil new file mode 100644 index 0000000000000..003f61ab988c5 --- /dev/null +++ b/test/IRGen/vtable_non_overridden.sil @@ -0,0 +1,68 @@ +// RUN: %target-swift-frontend -emit-ir %s | %FileCheck %s + +class InternalA { + init() + func foo() + func bar() + func bas() +} + +sil @InternalA_foo : $@convention(method) (@guaranteed InternalA) -> () +sil @InternalA_bar : $@convention(method) (@guaranteed InternalA) -> () +sil @InternalA_bas : $@convention(method) (@guaranteed InternalA) -> () +sil @InternalA_init : $@convention(method) (@thick InternalA.Type) -> @owned InternalA +sil @InternalA_dealloc : $@convention(method) (@owned InternalA) -> () + +sil_vtable InternalA { + #InternalA.deinit!deallocator : @InternalA_dealloc + #InternalA.init!allocator : @InternalA_init + #InternalA.foo : @InternalA_foo [nonoverridden] + #InternalA.bar : @InternalA_bar + #InternalA.bas : @InternalA_bas [nonoverridden] +} + +// -- only overridden entries in internal method descriptor table +// CHECK-LABEL: @"$s21vtable_non_overridden9InternalACMn" = +// CHECK-SAME: i32 2, %swift.method_descriptor +// CHECK-SAME: @InternalA_init +// CHECK-NOT: @InternalA_foo +// CHECK-SAME: @InternalA_bar +// CHECK-NOT: @InternalA_bas + +// -- only overridden entries in internal vtable +// CHECK-LABEL: @"$s21vtable_non_overridden9InternalACMf" = +// CHECK-SAME: @InternalA_init +// CHECK-NOT: @InternalA_foo +// CHECK-SAME: @InternalA_bar +// CHECK-NOT: @InternalA_bas + +sil @InternalB_bar : $@convention(method) (@guaranteed InternalB) -> () +sil @InternalB_init : $@convention(method) (@thick InternalB.Type) -> @owned InternalB +sil @InternalB_dealloc : $@convention(method) (@owned InternalB) -> () + +class InternalB: InternalA { + override func bar() +} + +sil_vtable InternalB { + #InternalB.deinit!deallocator : @InternalB_dealloc + #InternalA.init!allocator : @InternalB_init [override] + #InternalA.foo : @InternalA_foo [inherited] [nonoverridden] + #InternalA.bar : @InternalB_bar [override] + #InternalA.bas : @InternalA_bas [inherited] [nonoverridden] +} + +// -- only overridden entries in internal method descriptor table +// CHECK-LABEL: @"$s21vtable_non_overridden9InternalBCMn" = +// CHECK-SAME: i32 2, %swift.method_override_descriptor +// CHECK-NOT: @InternalA_foo +// CHECK-SAME: @InternalB_bar +// CHECK-NOT: @InternalA_bas +// CHECK-SAME: @InternalB_init + +// -- only overridden entries in internal vtable +// CHECK-LABEL: @"$s21vtable_non_overridden9InternalBCMf" = +// CHECK-SAME: @InternalB_init +// CHECK-NOT: @InternalA_foo +// CHECK-SAME: @InternalB_bar +// CHECK-NOT: @InternalA_bas diff --git a/test/Interop/Cxx/operators/Inputs/non-member-inline.h b/test/Interop/Cxx/operators/Inputs/non-member-inline.h index 7c4f28dfcd703..7704289b1ab1e 100644 --- a/test/Interop/Cxx/operators/Inputs/non-member-inline.h +++ b/test/Interop/Cxx/operators/Inputs/non-member-inline.h @@ -21,6 +21,18 @@ inline IntBox operator/(IntBox lhs, IntBox rhs) { return IntBox{.value = lhs.value / rhs.value}; } +inline IntBox operator%(IntBox lhs, IntBox rhs) { + return IntBox{.value = lhs.value % rhs.value}; +} + +inline IntBox operator&(IntBox lhs, IntBox rhs) { + return IntBox{.value = lhs.value & rhs.value}; +} + +inline IntBox operator|(IntBox lhs, IntBox rhs) { + return IntBox{.value = lhs.value | rhs.value}; +} + inline IntBox operator<<(IntBox lhs, IntBox rhs) { return IntBox{.value = lhs.value << rhs.value}; } diff --git a/test/Interop/Cxx/operators/non-member-inline-module-interface.swift b/test/Interop/Cxx/operators/non-member-inline-module-interface.swift index b056312cd4e26..36970d2fd2ddf 100644 --- a/test/Interop/Cxx/operators/non-member-inline-module-interface.swift +++ b/test/Interop/Cxx/operators/non-member-inline-module-interface.swift @@ -4,6 +4,9 @@ // CHECK-NEXT: func - (lhs: IntBox, rhs: IntBox) -> IntBox // CHECK-NEXT: func * (lhs: IntBox, rhs: IntBox) -> IntBox // CHECK-NEXT: func / (lhs: IntBox, rhs: IntBox) -> IntBox +// CHECK-NEXT: func % (lhs: IntBox, rhs: IntBox) -> IntBox +// CHECK-NEXT: func & (lhs: IntBox, rhs: IntBox) -> IntBox +// CHECK-NEXT: func | (lhs: IntBox, rhs: IntBox) -> IntBox // CHECK-NEXT: func << (lhs: IntBox, rhs: IntBox) -> IntBox // CHECK-NEXT: func >> (lhs: IntBox, rhs: IntBox) -> IntBox diff --git a/test/Interop/Cxx/operators/non-member-inline-typechecker.swift b/test/Interop/Cxx/operators/non-member-inline-typechecker.swift index 92a09901517be..ca4585b5a097a 100644 --- a/test/Interop/Cxx/operators/non-member-inline-typechecker.swift +++ b/test/Interop/Cxx/operators/non-member-inline-typechecker.swift @@ -9,6 +9,9 @@ let resultPlus = lhs + rhs let resultMinus = lhs - rhs let resultStar = lhs * rhs let resultSlash = lhs / rhs +let resultPercent = lhs % rhs +let resultAmp = lhs & rhs +let resultPipe = lhs | rhs let resultLessLess = lhs << rhs let resultGreaterGreater = lhs >> rhs diff --git a/test/Interop/Cxx/operators/non-member-inline.swift b/test/Interop/Cxx/operators/non-member-inline.swift index c383c165a980f..8d23461d9cd06 100644 --- a/test/Interop/Cxx/operators/non-member-inline.swift +++ b/test/Interop/Cxx/operators/non-member-inline.swift @@ -43,6 +43,33 @@ OperatorsTestSuite.test("slash (/)") { expectEqual(1, result.value) } +OperatorsTestSuite.test("percent") { + let lhs = IntBox(value: 11) + let rhs = IntBox(value: 2) + + let result = lhs % rhs + + expectEqual(1, result.value) +} + +OperatorsTestSuite.test("amp") { + let lhs = IntBox(value: 6) + let rhs = IntBox(value: 5) + + let result = lhs & rhs + + expectEqual(4, result.value) +} + +OperatorsTestSuite.test("pipe") { + let lhs = IntBox(value: 6) + let rhs = IntBox(value: 5) + + let result = lhs | rhs + + expectEqual(7, result.value) +} + OperatorsTestSuite.test("less less (<<)") { let lhs = IntBox(value: 2) let rhs = IntBox(value: 4) diff --git a/test/ModuleInterface/ModuleCache/prebuilt-module-cache-archs.swift b/test/ModuleInterface/ModuleCache/prebuilt-module-cache-archs.swift index 13523cf92440d..dc5c58f085ee1 100644 --- a/test/ModuleInterface/ModuleCache/prebuilt-module-cache-archs.swift +++ b/test/ModuleInterface/ModuleCache/prebuilt-module-cache-archs.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) // RUN: %empty-directory(%t/include/Lib.swiftmodule) -// RUN: cp %S/Inputs/prebuilt-module-cache/Lib.swiftinterface %t/include/Lib.swiftmodule/%target-cpu.swiftinterface +// RUN: cp %S/Inputs/prebuilt-module-cache/Lib.swiftinterface %t/include/Lib.swiftmodule/%target-swiftinterface-name // Baseline check: if the prebuilt cache path does not exist, everything should // still work. diff --git a/test/ModuleInterface/ModuleCache/prebuilt-module-cache-unusable.swift b/test/ModuleInterface/ModuleCache/prebuilt-module-cache-unusable.swift index 94ae8eb3afc96..ad87dcadadb8e 100644 --- a/test/ModuleInterface/ModuleCache/prebuilt-module-cache-unusable.swift +++ b/test/ModuleInterface/ModuleCache/prebuilt-module-cache-unusable.swift @@ -2,10 +2,10 @@ // RUN: %empty-directory(%t/MCP) // RUN: %empty-directory(%t/prebuilt-cache/Lib.swiftmodule) // RUN: %empty-directory(%t/include/Lib.swiftmodule) -// RUN: cp %S/Inputs/prebuilt-module-cache/Lib.swiftinterface %t/include/Lib.swiftmodule/%target-cpu.swiftinterface +// RUN: cp %S/Inputs/prebuilt-module-cache/Lib.swiftinterface %t/include/Lib.swiftmodule/%target-swiftinterface-name // Prebuild a module for the current target CPU, and put it in the prebuilt cache under some imaginary CPU. -// RUN: sed -e 's/FromInterface/FromPrebuilt/g' %t/include/Lib.swiftmodule/%target-cpu.swiftinterface | %target-swift-frontend -parse-stdlib -module-cache-path %t/MCP -emit-module-path %t/prebuilt-cache/Lib.swiftmodule/leg128.swiftmodule - -module-name Lib +// RUN: sed -e 's/FromInterface/FromPrebuilt/g' %t/include/Lib.swiftmodule/%target-swiftinterface-name | %target-swift-frontend -parse-stdlib -module-cache-path %t/MCP -emit-module-path %t/prebuilt-cache/Lib.swiftmodule/leg128.swiftmodule - -module-name Lib // Make sure that, if there's a module for a different architecture // present in the prebuilt cache, it's ignored and the module is diff --git a/test/ModuleInterface/ModuleCache/prefer-local-module-to-sdk-framework.swift b/test/ModuleInterface/ModuleCache/prefer-local-module-to-sdk-framework.swift index 3f913718429ba..817263c769088 100644 --- a/test/ModuleInterface/ModuleCache/prefer-local-module-to-sdk-framework.swift +++ b/test/ModuleInterface/ModuleCache/prefer-local-module-to-sdk-framework.swift @@ -5,11 +5,11 @@ // RUN: echo 'public func showsUpInBothPlaces() {}' > %t/Lib.swift // 1. Create a .swiftinterface file containing just one API, and put it inside a second build dir (without a .swiftmodule) -// RUN: %target-swift-frontend -typecheck %t/Lib.swift -emit-module-interface-path %t/SecondBuildDir/Lib.framework/Modules/Lib.swiftmodule/%target-cpu.swiftinterface -module-name Lib +// RUN: %target-swift-frontend -typecheck %t/Lib.swift -emit-module-interface-path %t/SecondBuildDir/Lib.framework/Modules/Lib.swiftmodule/%target-swiftinterface-name -module-name Lib // 2. Add a new API to the module, and compile just the serialized version in the build dir. // RUN: echo 'public func onlyInTheCompiledModule() {}' >> %t/Lib.swift -// RUN: %target-swift-frontend -emit-module %t/Lib.swift -o %t/BuildDir/Lib.framework/Modules/Lib.swiftmodule/%target-cpu.swiftmodule -emit-module-interface-path %t/BuildDir/Lib.framework/Modules/Lib.swiftmodule/%target-cpu.swiftinterface -module-name Lib +// RUN: %target-swift-frontend -emit-module %t/Lib.swift -o %t/BuildDir/Lib.framework/Modules/Lib.swiftmodule/%target-swiftmodule-name -emit-module-interface-path %t/BuildDir/Lib.framework/Modules/Lib.swiftmodule/%target-swiftinterface-name -module-name Lib // 3. Make sure when we compile this test file, we can access both APIs since we'll // load the compiled .swiftmodule instead of the .swiftinterface in the SDK. @@ -19,7 +19,7 @@ // RUN: ls %t/ModuleCache | not grep 'swiftmodule' // 5. This should also work if the swiftinterface isn't present in the first build dir. -// RUN: rm %t/BuildDir/Lib.framework/Modules/Lib.swiftmodule/%target-cpu.swiftinterface +// RUN: rm %t/BuildDir/Lib.framework/Modules/Lib.swiftmodule/%target-swiftinterface-name // RUN: %target-swift-frontend -typecheck %s -F %t/BuildDir -F %t/SecondBuildDir -module-cache-path %t/ModuleCache // 6. Make sure we /still/ didn't compile any .swiftinterfaces into the module cache. diff --git a/test/ModuleInterface/default-prebuilt-module-location.swift b/test/ModuleInterface/default-prebuilt-module-location.swift index d5c9582b0e03e..fc2640a33f6da 100644 --- a/test/ModuleInterface/default-prebuilt-module-location.swift +++ b/test/ModuleInterface/default-prebuilt-module-location.swift @@ -10,7 +10,7 @@ // 3. Compile this into a module and put it into the default prebuilt cache // location relative to the fake resource dir. Also drop an interface into // the build dir. -// RUN: %target-swift-frontend -emit-module %t/PrebuiltModule.swift -o %t/ResourceDir/%target-sdk-name/prebuilt-modules/PrebuiltModule.swiftmodule/%target-cpu.swiftmodule -module-name PrebuiltModule -parse-stdlib -emit-module-interface-path %t/PrebuiltModule.swiftmodule/%target-cpu.swiftinterface +// RUN: %target-swift-frontend -emit-module %t/PrebuiltModule.swift -o %t/ResourceDir/%target-sdk-name/prebuilt-modules/PrebuiltModule.swiftmodule/%target-swiftmodule-name -module-name PrebuiltModule -parse-stdlib -emit-module-interface-path %t/PrebuiltModule.swiftmodule/%target-swiftinterface-name // 4. Import this prebuilt module, but DON'T pass in -prebuilt-module-cache-path, it should use the implicit one. // RUN: %target-swift-frontend -typecheck -resource-dir %t/ResourceDir -I %t %s -parse-stdlib -module-cache-path %t/ModuleCache -sdk %t diff --git a/test/ModuleInterface/swift_build_sdk_interfaces/check-only-mode.swift b/test/ModuleInterface/swift_build_sdk_interfaces/check-only-mode.swift index fa60a806ad84c..3e499cae7a30e 100644 --- a/test/ModuleInterface/swift_build_sdk_interfaces/check-only-mode.swift +++ b/test/ModuleInterface/swift_build_sdk_interfaces/check-only-mode.swift @@ -2,9 +2,9 @@ // RUN: mkdir -p %t/sdk/usr/lib/swift/Normal.swiftmodule // RUN: mkdir -p %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule -// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name Normal +// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Normal // RUN: echo 'public func flat() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Flat.swiftinterface -emit-module -o /dev/null -module-name Flat -// RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name FMWK +// RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name FMWK // RUN: %swift_build_sdk_interfaces -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -v -o %t/prebuilt -check-only // RUN: ls %t/prebuilt | %FileCheck %s @@ -18,7 +18,7 @@ // Touch a file in the SDK (to make it look like it changed) and try again. // In -check-only mode, this should force a rebuild. // RUN: rm -rf %t/MCP -// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface +// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name // RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt // RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule diff --git a/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt.swift b/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt.swift index fdc22b4e71093..352734a2a5dcd 100644 --- a/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt.swift +++ b/test/ModuleInterface/swift_build_sdk_interfaces/compiler-uses-prebuilt.swift @@ -2,9 +2,9 @@ // RUN: mkdir -p %t/sdk/usr/lib/swift/Normal.swiftmodule // RUN: mkdir -p %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule -// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name Normal +// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Normal // RUN: echo 'public func flat() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Flat.swiftinterface -emit-module -o /dev/null -module-name Flat -// RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name FMWK +// RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name FMWK // RUN: %swift_build_sdk_interfaces -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -v -o %t/prebuilt // RUN: ls %t/prebuilt | %FileCheck %s @@ -19,7 +19,7 @@ // This should still be able to use the prebuilt modules because they track // content hashes, not just size+mtime. // RUN: rm -rf %t/MCP -// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface +// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name // RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt // RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s // RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule @@ -31,7 +31,7 @@ // Actually change a file in the SDK, to check that we're tracking dependencies // at all. // RUN: rm -rf %t/MCP -// RUN: echo "public func another()" >> %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface +// RUN: echo "public func another()" >> %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-swiftinterface-name // RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt // RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s // RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule diff --git a/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift b/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift index bf3e764bd3a15..7703e3c677bbc 100644 --- a/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift +++ b/test/ModuleInterface/swift_build_sdk_interfaces/track-system-dependencies.swift @@ -1,6 +1,6 @@ // RUN: %empty-directory(%t) // RUN: cp -r %S/Inputs/system-dependencies-sdk %t/sdk -// RUN: echo 'import Platform; public func usesCStruct(_: SomeCStruct?) {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Swifty.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name Swifty -sdk %t/sdk +// RUN: echo 'import Platform; public func usesCStruct(_: SomeCStruct?) {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Swifty.swiftmodule/%target-swiftinterface-name -emit-module -o /dev/null -module-name Swifty -sdk %t/sdk // RUN: %swift_build_sdk_interfaces -sdk %t/sdk -v -o %t/prebuilt // RUN: ls %t/prebuilt | %FileCheck %s diff --git a/test/Profiler/Inputs/coverage_num_threads1.swift b/test/Profiler/Inputs/coverage_num_threads1.swift new file mode 100644 index 0000000000000..6ca641732e7e1 --- /dev/null +++ b/test/Profiler/Inputs/coverage_num_threads1.swift @@ -0,0 +1 @@ +func func1() {} diff --git a/test/Profiler/Inputs/coverage_num_threads2.swift b/test/Profiler/Inputs/coverage_num_threads2.swift new file mode 100644 index 0000000000000..639ea1b4ad4b7 --- /dev/null +++ b/test/Profiler/Inputs/coverage_num_threads2.swift @@ -0,0 +1 @@ +func func2() {} diff --git a/test/Profiler/coverage_num_threads.swift b/test/Profiler/coverage_num_threads.swift new file mode 100644 index 0000000000000..12156483c079e --- /dev/null +++ b/test/Profiler/coverage_num_threads.swift @@ -0,0 +1,13 @@ +// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -num-threads 0 -emit-ir %S/Inputs/coverage_num_threads1.swift | %FileCheck %s -check-prefix=SINGLE-SOURCE --implicit-check-not="llvm_coverage_mapping =" + +// SINGLE-SOURCE: llvm_coverage_mapping = + +// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -num-threads 0 -emit-ir %S/Inputs/coverage_num_threads1.swift %S/Inputs/coverage_num_threads2.swift | %FileCheck %s -check-prefix=SINGLE-OBJECT --implicit-check-not="llvm_coverage_mapping =" + +// SINGLE-OBJECT: llvm_coverage_mapping = + +// Using 1 goes down the multithreaded codepath but only operates with a single thread to work around an issue on Windows where the output of both IR modules is interleaved and therefore the output is invalid +// RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -num-threads 1 -emit-ir %S/Inputs/coverage_num_threads1.swift %S/Inputs/coverage_num_threads2.swift | %FileCheck %s -check-prefix=MULTIPLE-OBJECTS --implicit-check-not="llvm_coverage_mapping =" + +// MULTIPLE-OBJECTS: llvm_coverage_mapping = +// MULTIPLE-OBJECTS: llvm_coverage_mapping = diff --git a/test/Runtime/environment_variables.swift b/test/Runtime/environment_variables.swift index c62a74c4b5e74..329ae76ea5ce1 100644 --- a/test/Runtime/environment_variables.swift +++ b/test/Runtime/environment_variables.swift @@ -3,6 +3,7 @@ // RUN: %target-codesign %t/main // REQUIRES: executable_test +// UNSUPPORTED: use_os_stdlib // RUN: env %env-SWIFT_DEBUG_HELP=YES %env-SWIFT_DEBUG_SOME_UNKNOWN_VARIABLE=42 %env-SWIFT_DEBUG_ENABLE_METADATA_ALLOCATION_ITERATION=YES %env-SWIFT_DEBUG_IMPLICIT_OBJC_ENTRYPOINT=abc %env-SWIFT_DETERMINISTIC_HASHING=whatever %env-SWIFT_ENABLE_MANGLED_NAME_VERIFICATION=YES %target-run %t/main 2>&1 | %FileCheck %s --dump-input fail diff --git a/test/SIL/Parser/basic.sil b/test/SIL/Parser/basic.sil index b144a203448b2..b74b3ec0a262d 100644 --- a/test/SIL/Parser/basic.sil +++ b/test/SIL/Parser/basic.sil @@ -1700,10 +1700,10 @@ sil_vtable Foo { } // CHECK-LABEL: sil_vtable Foo2 { -// CHECK: #Foo.subscript!getter: {{.*}} : @Foo_subscript_getter [inherited] +// CHECK: #Foo.subscript!getter: {{.*}} : @Foo_subscript_getter [inherited] [nonoverridden] // CHECK: #Foo.subscript!setter: {{.*}} : @Foo_subscript_setter [override] // CHECK: } sil_vtable Foo2 { - #Foo.subscript!getter: @Foo_subscript_getter [inherited] + #Foo.subscript!getter: @Foo_subscript_getter [inherited] [nonoverridden] #Foo.subscript!setter: @Foo_subscript_setter [override] } diff --git a/test/SILOptimizer/optionset.swift b/test/SILOptimizer/optionset.swift index 6e332bc27281e..4890c8bb5ca5a 100644 --- a/test/SILOptimizer/optionset.swift +++ b/test/SILOptimizer/optionset.swift @@ -12,7 +12,13 @@ public struct TestOptions: OptionSet { static let fourth = TestOptions(rawValue: 1 << 3) } -// CHECK: sil @{{.*}}returnTestOptions{{.*}} +// CHECK-LABEL: sil_global hidden [let] @$s4test17globalTestOptionsAA0cD0Vvp : $TestOptions = { +// CHECK: [[CONST:%.*]] = integer_literal $Builtin.Int{{32|64}}, 15 +// CHECK: [[INT:%.*]] = struct $Int (%0 : $Builtin.Int{{32|64}}) +// CHECK: %initval = struct $TestOptions ([[INT]] : $Int) +let globalTestOptions: TestOptions = [.first, .second, .third, .fourth] + +// CHECK-LABEL: sil @{{.*}}returnTestOptions{{.*}} // CHECK-NEXT: bb0: // CHECK-NEXT: builtin // CHECK-NEXT: integer_literal {{.*}}, 15 @@ -23,24 +29,13 @@ public func returnTestOptions() -> TestOptions { return [.first, .second, .third, .fourth] } -// CHECK: sil @{{.*}}returnEmptyTestOptions{{.*}} -// CHECK: [[ZERO:%[0-9]+]] = integer_literal {{.*}}, 0 -// CHECK: [[ZEROINT:%[0-9]+]] = struct $Int ([[ZERO]] -// CHECK: [[TO:%[0-9]+]] = struct $TestOptions ([[ZEROINT]] -// CHECK: return [[TO]] -// CHECK: } // end sil function {{.*}}returnEmptyTestOptions{{.*}} -public func returnEmptyTestOptions() -> TestOptions { - return [] -} - -// CHECK: alloc_global @{{.*}}globalTestOptions{{.*}} -// CHECK-NEXT: global_addr -// CHECK-NEXT: builtin -// CHECK-NEXT: integer_literal {{.*}}, 15 +// CHECK-LABEL: sil @{{.*}}returnEmptyTestOptions{{.*}} +// CHECK-NEXT: bb0: +// CHECK-NEXT: integer_literal {{.*}}, 0 +// CHECK-NEXT: builtin "onFastPath"() : $() // CHECK-NEXT: struct $Int // CHECK-NEXT: struct $TestOptions -// CHECK-NEXT: store -// CHECK-NEXT: tuple // CHECK-NEXT: return -let globalTestOptions: TestOptions = [.first, .second, .third, .fourth] - +public func returnEmptyTestOptions() -> TestOptions { + return [] +} diff --git a/test/Sema/enum_raw_representable_object_literals.swift b/test/Sema/enum_raw_representable_object_literals.swift new file mode 100644 index 0000000000000..f70bbcea068ce --- /dev/null +++ b/test/Sema/enum_raw_representable_object_literals.swift @@ -0,0 +1,19 @@ +// RUN: %target-typecheck-verify-swift +// REQUIRES: OS=ios + +import UIKit + +struct FooLiteral: _ExpressibleByColorLiteral, _ExpressibleByImageLiteral, _ExpressibleByFileReferenceLiteral { + init(_colorLiteralRed: Float, green: Float, blue: Float, alpha: Float) {} + init(imageLiteralResourceName: String) {} + init(fileReferenceLiteralResourceName: String) {} +} + +enum Foo: FooLiteral { // expected-error {{raw type 'FooLiteral' is not expressible by a string, integer, or floating-point literal}} + typealias RawValue = Never + var rawValue: Never { fatalError() } + init(rawValue: Never) { fatalError() } + case bar1 = #colorLiteral(red: 1, green: 0, blue: 0, alpha: 1) + case bar2 = #imageLiteral(resourceName: "hello.png") + case bar3 = #fileLiteral(resourceName: "what.txt") +} diff --git a/test/Serialization/load-target-fallback.swift b/test/Serialization/load-target-fallback.swift index 40009c445073f..a3f919734a522 100644 --- a/test/Serialization/load-target-fallback.swift +++ b/test/Serialization/load-target-fallback.swift @@ -5,23 +5,23 @@ // RUN: mkdir %t/TargetLibrary.swiftmodule // RUN: %target-swift-frontend -emit-module -o %t/TargetLibrary.swiftmodule/%module-target-triple.swiftmodule %S/Inputs/def_func.swift -module-name TargetLibrary -// RUN: touch %t/TargetLibrary.swiftmodule/%target-cpu.swiftmodule +// RUN: touch %t/TargetLibrary.swiftmodule/%target-swiftmodule-name import TargetLibrary // RUN: mkdir %t/ArchLibrary.swiftmodule -// RUN: %target-swift-frontend -emit-module -o %t/ArchLibrary.swiftmodule/%target-cpu.swiftmodule %S/Inputs/def_func.swift -module-name ArchLibrary +// RUN: %target-swift-frontend -emit-module -o %t/ArchLibrary.swiftmodule/%target-swiftmodule-name %S/Inputs/def_func.swift -module-name ArchLibrary import ArchLibrary // RUN: mkdir -p %t/TargetModule.framework/Modules/TargetModule.swiftmodule // RUN: %target-swift-frontend -emit-module -o %t/TargetModule.framework/Modules/TargetModule.swiftmodule/%module-target-triple.swiftmodule %S/Inputs/def_func.swift -module-name TargetModule -// RUN: touch %t/TargetModule.framework/Modules/TargetModule.swiftmodule/%target-cpu.swiftmodule +// RUN: touch %t/TargetModule.framework/Modules/TargetModule.swiftmodule/%target-swiftmodule-name import TargetModule // RUN: mkdir -p %t/ArchModule.framework/Modules/ArchModule.swiftmodule -// RUN: %target-swift-frontend -emit-module -o %t/ArchModule.framework/Modules/ArchModule.swiftmodule/%target-cpu.swiftmodule %S/Inputs/def_func.swift -module-name ArchModule +// RUN: %target-swift-frontend -emit-module -o %t/ArchModule.framework/Modules/ArchModule.swiftmodule/%target-swiftmodule-name %S/Inputs/def_func.swift -module-name ArchModule import ArchModule diff --git a/test/SourceKit/Indexing/Inputs/explicit-access/Exported.swift b/test/SourceKit/Indexing/Inputs/explicit-access/Exported.swift new file mode 100644 index 0000000000000..9f5bcfecd1473 --- /dev/null +++ b/test/SourceKit/Indexing/Inputs/explicit-access/Exported.swift @@ -0,0 +1 @@ +public class ExportedClass {} diff --git a/test/SourceKit/Indexing/Inputs/explicit-access/Module.swift b/test/SourceKit/Indexing/Inputs/explicit-access/Module.swift new file mode 100644 index 0000000000000..40872cea6ee6f --- /dev/null +++ b/test/SourceKit/Indexing/Inputs/explicit-access/Module.swift @@ -0,0 +1,2 @@ +@_exported import Exported +public class ModuleClass {} diff --git a/test/SourceKit/Indexing/Inputs/implicit-vis/a.index.response b/test/SourceKit/Indexing/Inputs/implicit-vis/a.index.response index 7e206b4966cbd..5293536da6ab4 100644 --- a/test/SourceKit/Indexing/Inputs/implicit-vis/a.index.response +++ b/test/SourceKit/Indexing/Inputs/implicit-vis/a.index.response @@ -38,7 +38,8 @@ key.is_dynamic: 1, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.class, @@ -47,7 +48,8 @@ key.line: 2, key.column: 9 } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/Inputs/implicit-vis/b.index.response b/test/SourceKit/Indexing/Inputs/implicit-vis/b.index.response index 5960c9fdc9048..bdee38bf38ada 100644 --- a/test/SourceKit/Indexing/Inputs/implicit-vis/b.index.response +++ b/test/SourceKit/Indexing/Inputs/implicit-vis/b.index.response @@ -38,7 +38,8 @@ key.is_dynamic: 1, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.class, @@ -47,7 +48,8 @@ key.line: 2, key.column: 9 } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/Inputs/test_module.index.response b/test/SourceKit/Indexing/Inputs/test_module.index.response index 0fd7532830caa..85b907997c761 100644 --- a/test/SourceKit/Indexing/Inputs/test_module.index.response +++ b/test/SourceKit/Indexing/Inputs/test_module.index.response @@ -25,7 +25,8 @@ { key.kind: source.lang.swift.decl.class, key.name: "Empty", - key.usr: "s:11test_module5EmptyC" + key.usr: "s:11test_module5EmptyC", + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.class, @@ -49,7 +50,8 @@ key.is_dynamic: 1, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.var.instance, @@ -68,14 +70,17 @@ key.is_dynamic: 1, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.function.constructor, key.name: "init(a:b:)", - key.usr: "s:11test_module7TwoIntsC1a1bACSi_Sitcfc" + key.usr: "s:11test_module7TwoIntsC1a1bACSi_Sitcfc", + key.effective_access: source.decl.effective_access.public } - ] + ], + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.class, @@ -99,14 +104,17 @@ key.usr: "s:11test_module16ComputedPropertyC5valueSivs", key.is_dynamic: 1 } - ] + ], + key.effective_access: source.decl.effective_access.public } - ] + ], + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.protocol, key.name: "Prot1", - key.usr: "s:11test_module5Prot1P" + key.usr: "s:11test_module5Prot1P", + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.protocol, @@ -118,17 +126,20 @@ key.name: "Prot1", key.usr: "s:11test_module5Prot1P" } - ] + ], + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.protocol, key.name: "Prot3", - key.usr: "s:11test_module5Prot3P" + key.usr: "s:11test_module5Prot3P", + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.class, key.name: "C2", - key.usr: "s:11test_module2C2C" + key.usr: "s:11test_module2C2C", + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.extension.class, @@ -155,7 +166,8 @@ { key.kind: source.lang.swift.decl.function.free, key.name: "globalFunc()", - key.usr: "s:11test_module10globalFuncyyF" + key.usr: "s:11test_module10globalFuncyyF", + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.extension.class, diff --git a/test/SourceKit/Indexing/index.swift.response b/test/SourceKit/Indexing/index.swift.response index b81edd4fb070e..dd07c5020b0af 100644 --- a/test/SourceKit/Indexing/index.swift.response +++ b/test/SourceKit/Indexing/index.swift.response @@ -29,7 +29,8 @@ key.column: 5, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -50,7 +51,8 @@ key.name: "init()", key.usr: , key.line: 7, - key.column: 3 + key.column: 3, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.var.instance, @@ -75,7 +77,8 @@ key.is_dynamic: 1, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.class, @@ -90,7 +93,8 @@ key.usr: , key.line: 9, key.column: 8, - key.is_dynamic: 1 + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -121,7 +125,8 @@ key.line: 10, key.column: 45 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -152,7 +157,8 @@ key.line: 13, key.column: 47 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.class, @@ -160,9 +166,11 @@ key.usr: , key.line: 16, key.column: 14, - key.is_dynamic: 1 + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.operator.infix, @@ -192,7 +200,8 @@ key.line: 19, key.column: 26 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.struct, @@ -206,23 +215,27 @@ key.name: "meth()", key.usr: , key.line: 24, - key.column: 8 + key.column: 8, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.static, key.name: "smeth()", key.usr: , key.line: 25, - key.column: 15 + key.column: 15, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: , key.line: 23, key.column: 8, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.enum, @@ -236,9 +249,11 @@ key.name: "EElem", key.usr: , key.line: 29, - key.column: 8 + key.column: 8, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.protocol, @@ -262,9 +277,11 @@ key.line: 33, key.column: 22 } - ] + ], + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.free, @@ -373,7 +390,8 @@ key.line: 42, key.column: 14 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.typealias, @@ -389,7 +407,8 @@ key.line: 47, key.column: 21 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.extension.class, @@ -436,7 +455,8 @@ key.line: 50, key.column: 19 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -460,7 +480,8 @@ key.line: 51, key.column: 22 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.var.instance, @@ -477,7 +498,8 @@ key.column: 18, key.is_dynamic: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -516,7 +538,8 @@ key.name: "protMeth(_:)", key.usr: } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.class, @@ -542,9 +565,11 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.var.global, @@ -567,7 +592,8 @@ key.column: 5, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.class, @@ -606,7 +632,8 @@ key.column: 5, key.is_dynamic: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -630,7 +657,8 @@ key.column: 22, key.is_dynamic: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -644,9 +672,11 @@ key.usr: , key.line: 59, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -670,16 +700,19 @@ key.line: 74, key.column: 22 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: , key.line: 73, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -750,7 +783,8 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, @@ -769,9 +803,11 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -827,16 +863,19 @@ key.line: 81, key.column: 26 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: , key.line: 80, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.free, @@ -949,7 +988,8 @@ } ] } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.struct, @@ -963,16 +1003,19 @@ key.name: "sfoo()", key.usr: , key.line: 102, - key.column: 8 + key.column: 8, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: , key.line: 101, key.column: 8, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.var.global, @@ -1004,7 +1047,8 @@ } ] } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -1044,7 +1088,8 @@ key.column: 16, key.receiver_usr: "s:5index2S2V" } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -1059,16 +1104,19 @@ key.usr: , key.line: 116, key.column: 8, - key.is_dynamic: 1 + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: , key.line: 115, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -1139,7 +1187,8 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, @@ -1158,9 +1207,11 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.free, @@ -1207,14 +1258,16 @@ key.column: 5, key.receiver_usr: "s:5index2S2V" } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, key.name: "meth()", key.usr: , key.line: 134, - key.column: 8 + key.column: 8, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -1251,16 +1304,19 @@ { key.attribute: source.decl.attribute.convenience } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: , key.line: 137, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -1314,7 +1370,8 @@ key.column: 11, key.receiver_usr: "s:5index3CC4C" } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, @@ -1333,9 +1390,11 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -1349,7 +1408,8 @@ key.name: "init()", key.usr: , key.line: 150, - key.column: 3 + key.column: 3, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.var.instance, @@ -1406,7 +1466,8 @@ } ] } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -1415,7 +1476,8 @@ key.line: 151, key.column: 23 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -1454,7 +1516,8 @@ key.line: 170, key.column: 5 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -1468,9 +1531,11 @@ key.usr: , key.line: 162, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.protocol, @@ -1510,7 +1575,8 @@ key.column: 5, key.is_dynamic: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -1519,7 +1585,8 @@ key.line: 176, key.column: 11 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -1533,14 +1600,16 @@ key.usr: , key.line: 184, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } ], key.attributes: [ { key.attribute: source.decl.attribute.available } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -1554,14 +1623,16 @@ key.usr: , key.line: 188, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } ], key.attributes: [ { key.attribute: source.decl.attribute.available } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -1575,14 +1646,16 @@ key.usr: , key.line: 192, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } ], key.attributes: [ { key.attribute: source.decl.attribute.available } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/index_bad_modulename.swift.response b/test/SourceKit/Indexing/index_bad_modulename.swift.response index cfa072fec71ae..f3477de5260a6 100644 --- a/test/SourceKit/Indexing/index_bad_modulename.swift.response +++ b/test/SourceKit/Indexing/index_bad_modulename.swift.response @@ -70,7 +70,8 @@ key.column: 5, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.class, diff --git a/test/SourceKit/Indexing/index_big_array.swift.response b/test/SourceKit/Indexing/index_big_array.swift.response index 4c7c18feeb99f..771e817e978e9 100644 --- a/test/SourceKit/Indexing/index_big_array.swift.response +++ b/test/SourceKit/Indexing/index_big_array.swift.response @@ -29,7 +29,8 @@ key.column: 5, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, diff --git a/test/SourceKit/Indexing/index_constructors.swift.response b/test/SourceKit/Indexing/index_constructors.swift.response index 2f5bdf7b05495..186a1efaea342 100644 --- a/test/SourceKit/Indexing/index_constructors.swift.response +++ b/test/SourceKit/Indexing/index_constructors.swift.response @@ -61,7 +61,8 @@ key.is_dynamic: 1, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -77,9 +78,11 @@ { key.attribute: source.decl.attribute.objc } - ] + ], + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/index_effective_access_level.swift b/test/SourceKit/Indexing/index_effective_access_level.swift new file mode 100644 index 0000000000000..6f82492e44a6e --- /dev/null +++ b/test/SourceKit/Indexing/index_effective_access_level.swift @@ -0,0 +1,218 @@ +// RUN: %empty-directory(%t) +// RUN: %swift -emit-module -o %t/Exported.swiftmodule %S/Inputs/explicit-access/Exported.swift +// RUN: %swift -emit-module -o %t/Module.swiftmodule %S/Inputs/explicit-access/Module.swift -I %t + +// RUN: %sourcekitd-test -req=index %s -- -I %t %s | %sed_clean > %t.response +// RUN: %diff -u %s.response %t.response + +public enum PublicEnum { + case publicEnumCase +} + +enum InternalEnum { + case internalEnumCase +} + +fileprivate enum FilePrivateEnum { + case filePrivateEnumCase +} + +private enum PrivateEnum { + case privateEnumCase +} + +extension PublicEnum { + public func publicMethod() {} +} + +public extension PublicEnum { + func methodFromPublicExtension() {} +} + +extension InternalEnum { + func internalMethod() {} +} + +extension FilePrivateEnum { + fileprivate func filePrivateMethod() {} +} + +fileprivate extension FilePrivateEnum { + func methodFromFilePrivateExtension() {} +} + +extension PrivateEnum { + private func privateMethod() {} +} + +private extension PrivateEnum { + func methodFromPrivateExtension() {} +} + +@propertyWrapper +public struct PublicPropertyWrapper { + public var wrappedValue: T + public init(wrappedValue: T) { + self.wrappedValue = wrappedValue + } +} + +@propertyWrapper +struct InternalPropertyWrapper { + let wrappedValue: T +} + +@propertyWrapper +fileprivate struct FilePrivatePropertyWrapper { + fileprivate let wrappedValue: T +} + +@propertyWrapper +private struct PrivatePropertyWrapper { + private let wrappedValue: T +} + +private struct ScopeReducerStruct { + public init(publicInitializer: Int) {} + init(internalInitializer: Int) {} + fileprivate init(filePrivateInitializer: Int) {} + private init(privateInitializer: Int) {} + + public let publicProperty: Int = 0 + let internalProperty: Int = 0 + fileprivate let filePrivateProperty: Int = 0 + private let privateProperty: Int = 0 + public private(set) var publicPropertyWithPrivateSetter: Int = 0 + + @PublicPropertyWrapper public var publicPropertyWrappedProperty: Int = 0 + @PublicPropertyWrapper var internalPropertyWrappedProperty: Int = 0 + @PublicPropertyWrapper fileprivate var filePrivatePropertyWrappedProperty: Int = 0 + @PublicPropertyWrapper private var privatePropertyWrappedProperty: Int = 0 + + public subscript(publicSubscript: Int) -> Int { return 0 } + subscript(internalSubscript: Int) -> Int { return 0 } + fileprivate subscript(filePrivateSubscript: Int) -> Int { return 0 } + private subscript(privateSubscript: Int) -> Int { return 0 } + + public func publicMethod() {} + func internalMethod() {} + fileprivate func filePrivateMethod() {} + private func privateMethod() {} +} + +public struct ScopeKeeperStruct { + public init(publicInitializer: Int) {} + init(internalInitializer: Int) {} + fileprivate init(filePrivateInitializer: Int) {} + private init(privateInitializer: Int) {} + + public let publicProperty: Int = 0 + let internalProperty: Int = 0 + fileprivate let filePrivateProperty: Int = 0 + private let privateProperty: Int = 0 + public private(set) var publicPropertyWithPrivateSetter: Int = 0 + + @PublicPropertyWrapper public var publicPropertyWrappedProperty: Int = 0 + @PublicPropertyWrapper var internalPropertyWrappedProperty: Int = 0 + @PublicPropertyWrapper fileprivate var filePrivatePropertyWrappedProperty: Int = 0 + @PublicPropertyWrapper private var privatePropertyWrappedProperty: Int = 0 + + public subscript(publicSubscript: Int) -> Int { return 0 } + subscript(internalSubscript: Int) -> Int { return 0 } + fileprivate subscript(filePrivateSubscript: Int) -> Int { return 0 } + private subscript(privateSubscript: Int) -> Int { return 0 } + + public func publicMethod() {} + func internalMethod() {} + fileprivate func filePrivateMethod() {} + private func privateMethod() {} +} + +struct PartialScopeReducerStruct { + public init(publicInitializer: Int) {} + init(internalInitializer: Int) {} + fileprivate init(filePrivateInitializer: Int) {} + private init(privateInitializer: Int) {} + + public let publicProperty: Int = 0 + let internalProperty: Int = 0 + fileprivate let filePrivateProperty: Int = 0 + private let privateProperty: Int = 0 + public private(set) var publicPropertyWithPrivateSetter: Int = 0 + + @PublicPropertyWrapper public var publicPropertyWrappedProperty: Int = 0 + @PublicPropertyWrapper var internalPropertyWrappedProperty: Int = 0 + @PublicPropertyWrapper fileprivate var filePrivatePropertyWrappedProperty: Int = 0 + @PublicPropertyWrapper private var privatePropertyWrappedProperty: Int = 0 + + public subscript(publicSubscript: Int) -> Int { return 0 } + subscript(internalSubscript: Int) -> Int { return 0 } + fileprivate subscript(filePrivateSubscript: Int) -> Int { return 0 } + private subscript(privateSubscript: Int) -> Int { return 0 } + + public func publicMethod() {} + func internalMethod() {} + fileprivate func filePrivateMethod() {} + private func privateMethod() {} +} + +private extension PrivateEnum { + private func privateMethodFromPrivateExtension() {} +} + +public protocol PublicProtocol { + var member: Int { get set } + func method() +} + +protocol InternalProtocol { + var member: Int { get set } + func method() +} + +fileprivate protocol FilePrivateProtocol { + var member: Int { get set } + func method() +} + +private protocol PrivateProtocol { + var member: Int { get set } + func method() +} + +fileprivate struct FilePrivateImplementationOfPublicProtocol: PublicProtocol { + fileprivate var member: Int = 0 + fileprivate func method() {} +} + +open class OpenClass { + open var openProperty: Int { return 0 } + public var publicProperty: Int { return 0 } + var internalProperty: Int { return 0 } + + open func openMethod() {} + public func publicMethod() {} + func internalMethod() {} +} + +import Module + +struct InternalStruct { + let propertyReferencingPublicClassFromModule: Module.ModuleClass + let propertyReferencingPublicClassFromExportedModule: Exported.ExportedClass +} + +public typealias Alias = Int + +public var globalVariable: Int = 0 + +protocol ProtocolWithAssociatedType { + associatedtype T +} + +struct ProtocolWithAssociatedTypeImpl: ProtocolWithAssociatedType { + typealias T = Int + func testLocalContent() { + let localVariableShouldntBeIndexed = 0 + } +} diff --git a/test/SourceKit/Indexing/index_effective_access_level.swift.response b/test/SourceKit/Indexing/index_effective_access_level.swift.response new file mode 100644 index 0000000000000..2096c5271cfe6 --- /dev/null +++ b/test/SourceKit/Indexing/index_effective_access_level.swift.response @@ -0,0 +1,3782 @@ +{ + key.dependencies: [ + { + key.kind: source.lang.swift.import.module.swift, + key.name: "Swift", + key.filepath: Swift.swiftmodule, + key.is_system: 1 + }, + { + key.kind: source.lang.swift.import.module.swift, + key.name: "Module", + key.filepath: Module.swiftmodule, + key.dependencies: [ + { + key.kind: source.lang.swift.import.module.swift, + key.name: "Exported", + key.filepath: Exported.swiftmodule, + key.dependencies: [ + { + key.kind: source.lang.swift.import.module.swift, + key.name: "Swift", + key.filepath: Swift.swiftmodule, + key.is_system: 1 + }, + { + key.kind: source.lang.swift.import.module.swift, + key.name: "SwiftOnoneSupport", + key.filepath: SwiftOnoneSupport.swiftmodule, + key.is_system: 1, + key.dependencies: [ + { + key.kind: source.lang.swift.import.module.swift, + key.name: "Swift", + key.filepath: Swift.swiftmodule, + key.is_system: 1 + } + ] + } + ] + }, + { + key.kind: source.lang.swift.import.module.swift, + key.name: "Swift", + key.filepath: Swift.swiftmodule, + key.is_system: 1 + }, + { + key.kind: source.lang.swift.import.module.swift, + key.name: "SwiftOnoneSupport", + key.filepath: SwiftOnoneSupport.swiftmodule, + key.is_system: 1 + } + ] + } + ], + key.entities: [ + { + key.kind: source.lang.swift.decl.enum, + key.name: "PublicEnum", + key.usr: "s:28index_effective_access_level10PublicEnumO", + key.line: 8, + key.column: 13, + key.entities: [ + { + key.kind: source.lang.swift.decl.enumelement, + key.name: "publicEnumCase", + key.usr: "s:28index_effective_access_level10PublicEnumO06publicF4CaseyA2CmF", + key.line: 9, + key.column: 10, + key.effective_access: source.decl.effective_access.public + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.enum, + key.name: "InternalEnum", + key.usr: "s:28index_effective_access_level12InternalEnumO", + key.line: 12, + key.column: 6, + key.entities: [ + { + key.kind: source.lang.swift.decl.enumelement, + key.name: "internalEnumCase", + key.usr: "s:28index_effective_access_level12InternalEnumO08internalF4CaseyA2CmF", + key.line: 13, + key.column: 10, + key.effective_access: source.decl.effective_access.internal + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.enum, + key.name: "FilePrivateEnum", + key.usr: "s:28index_effective_access_level15FilePrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO", + key.line: 16, + key.column: 18, + key.entities: [ + { + key.kind: source.lang.swift.decl.enumelement, + key.name: "filePrivateEnumCase", + key.usr: "s:28index_effective_access_level15FilePrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO04filefG4CaseyA2DmF", + key.line: 17, + key.column: 10, + key.effective_access: source.decl.effective_access.fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.enum, + key.name: "PrivateEnum", + key.usr: "s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO", + key.line: 20, + key.column: 14, + key.entities: [ + { + key.kind: source.lang.swift.decl.enumelement, + key.name: "privateEnumCase", + key.usr: "s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO07privateF4CaseyA2DmF", + key.line: 21, + key.column: 10, + key.effective_access: source.decl.effective_access.fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.extension.enum, + key.name: "PublicEnum", + key.usr: "s:e:s:28index_effective_access_level10PublicEnumO12publicMethodyyF", + key.line: 24, + key.column: 11, + key.entities: [ + { + key.kind: source.lang.swift.ref.enum, + key.name: "PublicEnum", + key.usr: "s:28index_effective_access_level10PublicEnumO", + key.line: 24, + key.column: 11 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "publicMethod()", + key.usr: "s:28index_effective_access_level10PublicEnumO12publicMethodyyF", + key.line: 25, + key.column: 17, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.extension.enum, + key.name: "PublicEnum", + key.usr: "s:e:s:28index_effective_access_level10PublicEnumO010methodFromE9ExtensionyyF", + key.line: 28, + key.column: 18, + key.entities: [ + { + key.kind: source.lang.swift.ref.enum, + key.name: "PublicEnum", + key.usr: "s:28index_effective_access_level10PublicEnumO", + key.line: 28, + key.column: 18 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "methodFromPublicExtension()", + key.usr: "s:28index_effective_access_level10PublicEnumO010methodFromE9ExtensionyyF", + key.line: 29, + key.column: 10, + key.effective_access: source.decl.effective_access.public + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.extension.enum, + key.name: "InternalEnum", + key.usr: "s:e:s:28index_effective_access_level12InternalEnumO14internalMethodyyF", + key.line: 32, + key.column: 11, + key.entities: [ + { + key.kind: source.lang.swift.ref.enum, + key.name: "InternalEnum", + key.usr: "s:28index_effective_access_level12InternalEnumO", + key.line: 32, + key.column: 11 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "internalMethod()", + key.usr: "s:28index_effective_access_level12InternalEnumO14internalMethodyyF", + key.line: 33, + key.column: 10, + key.effective_access: source.decl.effective_access.internal + } + ] + }, + { + key.kind: source.lang.swift.decl.extension.enum, + key.name: "FilePrivateEnum", + key.usr: "s:e:s:28index_effective_access_level15FilePrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO04fileF6MethodyyF", + key.line: 36, + key.column: 11, + key.entities: [ + { + key.kind: source.lang.swift.ref.enum, + key.name: "FilePrivateEnum", + key.usr: "s:28index_effective_access_level15FilePrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO", + key.line: 36, + key.column: 11 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "filePrivateMethod()", + key.usr: "s:28index_effective_access_level15FilePrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO04fileF6MethodyyF", + key.line: 37, + key.column: 22, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + }, + { + key.kind: source.lang.swift.decl.extension.enum, + key.name: "FilePrivateEnum", + key.usr: "s:e:s:28index_effective_access_level15FilePrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO010methodFromeF9ExtensionyyF", + key.line: 40, + key.column: 23, + key.entities: [ + { + key.kind: source.lang.swift.ref.enum, + key.name: "FilePrivateEnum", + key.usr: "s:28index_effective_access_level15FilePrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO", + key.line: 40, + key.column: 23 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "methodFromFilePrivateExtension()", + key.usr: "s:28index_effective_access_level15FilePrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO010methodFromeF9ExtensionyyF", + key.line: 41, + key.column: 10, + key.effective_access: source.decl.effective_access.fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + }, + { + key.kind: source.lang.swift.decl.extension.enum, + key.name: "PrivateEnum", + key.usr: "s:e:s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO13privateMethodyyF", + key.line: 44, + key.column: 11, + key.entities: [ + { + key.kind: source.lang.swift.ref.enum, + key.name: "PrivateEnum", + key.usr: "s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO", + key.line: 44, + key.column: 11 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "privateMethod()", + key.usr: "s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO13privateMethodyyF", + key.line: 45, + key.column: 18, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + }, + { + key.kind: source.lang.swift.decl.extension.enum, + key.name: "PrivateEnum", + key.usr: "s:e:s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO010methodFromE9ExtensionyyF", + key.line: 48, + key.column: 19, + key.entities: [ + { + key.kind: source.lang.swift.ref.enum, + key.name: "PrivateEnum", + key.usr: "s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO", + key.line: 48, + key.column: 19 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "methodFromPrivateExtension()", + key.usr: "s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO010methodFromE9ExtensionyyF", + key.line: 49, + key.column: 10, + key.effective_access: source.decl.effective_access.fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 53, + key.column: 15, + key.entities: [ + { + key.kind: source.lang.swift.decl.generic_type_param, + key.name: "T", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV1Txmfp", + key.line: 53, + key.column: 37 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "wrappedValue", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValuexvp", + key.line: 54, + key.column: 16, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValuexvg", + key.line: 54, + key.column: 16, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValuexvs", + key.line: 54, + key.column: 16, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "T", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV1Txmfp", + key.line: 54, + key.column: 30 + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(wrappedValue:)", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 55, + key.column: 12, + key.entities: [ + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "T", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV1Txmfp", + key.line: 55, + key.column: 31 + }, + { + key.kind: source.lang.swift.ref.var.instance, + key.name: "wrappedValue", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValuexvp", + key.line: 56, + key.column: 14, + key.entities: [ + { + key.kind: source.lang.swift.ref.function.accessor.setter, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValuexvs", + key.line: 56, + key.column: 14, + key.receiver_usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.is_implicit: 1 + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute.propertyWrapper + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "InternalPropertyWrapper", + key.usr: "s:28index_effective_access_level23InternalPropertyWrapperV", + key.line: 61, + key.column: 8, + key.entities: [ + { + key.kind: source.lang.swift.decl.generic_type_param, + key.name: "T", + key.usr: "s:28index_effective_access_level23InternalPropertyWrapperV1Txmfp", + key.line: 61, + key.column: 32 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "wrappedValue", + key.usr: "s:28index_effective_access_level23InternalPropertyWrapperV12wrappedValuexvp", + key.line: 62, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level23InternalPropertyWrapperV12wrappedValuexvg", + key.line: 62, + key.column: 9, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level23InternalPropertyWrapperV12wrappedValuexvs", + key.line: 62, + key.column: 9, + key.is_implicit: 1 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "T", + key.usr: "s:28index_effective_access_level23InternalPropertyWrapperV1Txmfp", + key.line: 62, + key.column: 23 + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.usr: "s:28index_effective_access_level23InternalPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 61, + key.column: 8, + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.propertyWrapper + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "FilePrivatePropertyWrapper", + key.usr: "s:28index_effective_access_level26FilePrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV", + key.line: 66, + key.column: 20, + key.entities: [ + { + key.kind: source.lang.swift.decl.generic_type_param, + key.name: "T", + key.usr: "s:28index_effective_access_level26FilePrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV1Txmfp", + key.line: 66, + key.column: 47 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "wrappedValue", + key.usr: "s:28index_effective_access_level26FilePrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV12wrappedValuexvp", + key.line: 67, + key.column: 21, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level26FilePrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV12wrappedValuexvg", + key.line: 67, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level26FilePrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV12wrappedValuexvs", + key.line: 67, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "T", + key.usr: "s:28index_effective_access_level26FilePrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV1Txmfp", + key.line: 67, + key.column: 35 + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.usr: "s:28index_effective_access_level26FilePrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV12wrappedValueADyxGx_tcfc", + key.line: 66, + key.column: 20, + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute.propertyWrapper + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "PrivatePropertyWrapper", + key.usr: "s:28index_effective_access_level22PrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV", + key.line: 71, + key.column: 16, + key.entities: [ + { + key.kind: source.lang.swift.decl.generic_type_param, + key.name: "T", + key.usr: "s:28index_effective_access_level22PrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV1Txmfp", + key.line: 71, + key.column: 39 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "wrappedValue", + key.usr: "s:28index_effective_access_level22PrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV12wrappedValuexvp", + key.line: 72, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level22PrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV12wrappedValuexvg", + key.line: 72, + key.column: 17, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level22PrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV12wrappedValuexvs", + key.line: 72, + key.column: 17, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "T", + key.usr: "s:28index_effective_access_level22PrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV1Txmfp", + key.line: 72, + key.column: 31 + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.usr: "s:28index_effective_access_level22PrivatePropertyWrapper33_2295DDF1454D6A6D9229E8222CD85214LLV12wrappedValueADyxGx_tcfc", + key.line: 71, + key.column: 16, + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.less_than_fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute.propertyWrapper + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "ScopeReducerStruct", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV", + key.line: 75, + key.column: 16, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(publicInitializer:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV17publicInitializerADSi_tcfc", + key.line: 76, + key.column: 12, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 76, + key.column: 36 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(internalInitializer:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV19internalInitializerADSi_tcfc", + key.line: 77, + key.column: 5, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 77, + key.column: 31 + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(filePrivateInitializer:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV22filePrivateInitializerADSi_tcfc", + key.line: 78, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 78, + key.column: 46 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(privateInitializer:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV18privateInitializerADSi_tcfc", + key.line: 79, + key.column: 13, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 79, + key.column: 38 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicProperty", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV14publicPropertySivp", + key.line: 81, + key.column: 16, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV14publicPropertySivg", + key.line: 81, + key.column: 16, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV14publicPropertySivs", + key.line: 81, + key.column: 16, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 81, + key.column: 32 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "internalProperty", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV16internalPropertySivp", + key.line: 82, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV16internalPropertySivg", + key.line: 82, + key.column: 9, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV16internalPropertySivs", + key.line: 82, + key.column: 9, + key.is_implicit: 1 + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 82, + key.column: 27 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "filePrivateProperty", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV19filePrivatePropertySivp", + key.line: 83, + key.column: 21, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV19filePrivatePropertySivg", + key.line: 83, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV19filePrivatePropertySivs", + key.line: 83, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 83, + key.column: 42 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "privateProperty", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV15privatePropertySivp", + key.line: 84, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV15privatePropertySivg", + key.line: 84, + key.column: 17, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV15privatePropertySivs", + key.line: 84, + key.column: 17, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 84, + key.column: 34 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicPropertyWithPrivateSetter", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV31publicPropertyWithPrivateSetterSivp", + key.line: 85, + key.column: 29, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV31publicPropertyWithPrivateSetterSivg", + key.line: 85, + key.column: 29, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.setter_access.private + }, + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV31publicPropertyWithPrivateSetterSivs", + key.line: 85, + key.column: 29, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.setter_access.private + }, + { + key.attribute: source.decl.attribute.public + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.setter_access.private + }, + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 85, + key.column: 62 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 87, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 87, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicPropertyWrappedProperty", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV021publicPropertyWrappedO0Sivp", + key.line: 87, + key.column: 39, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV021publicPropertyWrappedO0Sivg", + key.line: 87, + key.column: 39, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV021publicPropertyWrappedO0Sivs", + key.line: 87, + key.column: 39, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 87, + key.column: 70 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 88, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 88, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "internalPropertyWrappedProperty", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV023internalPropertyWrappedO0Sivp", + key.line: 88, + key.column: 32, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV023internalPropertyWrappedO0Sivg", + key.line: 88, + key.column: 32, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV023internalPropertyWrappedO0Sivs", + key.line: 88, + key.column: 32, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 88, + key.column: 65 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 89, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 89, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "filePrivatePropertyWrappedProperty", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV026filePrivatePropertyWrappedP0Sivp", + key.line: 89, + key.column: 44, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV026filePrivatePropertyWrappedP0Sivg", + key.line: 89, + key.column: 44, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV026filePrivatePropertyWrappedP0Sivs", + key.line: 89, + key.column: 44, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 89, + key.column: 80 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 90, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 90, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "privatePropertyWrappedProperty", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV022privatePropertyWrappedO0Sivp", + key.line: 90, + key.column: 40, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV022privatePropertyWrappedO0Sivg", + key.line: 90, + key.column: 40, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV022privatePropertyWrappedO0Sivs", + key.line: 90, + key.column: 40, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 90, + key.column: 72 + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLVyS2icip", + key.line: 92, + key.column: 12, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLVyS2icig", + key.line: 92, + key.column: 51 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 92, + key.column: 39 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 92, + key.column: 47 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLVXeip", + key.line: 93, + key.column: 5, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLVXeig", + key.line: 93, + key.column: 46 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 93, + key.column: 34 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 93, + key.column: 42 + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLVXeip", + key.line: 94, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLVXeig", + key.line: 94, + key.column: 61 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 94, + key.column: 49 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 94, + key.column: 57 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLVXeip", + key.line: 95, + key.column: 13, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLVXeig", + key.line: 95, + key.column: 53 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 95, + key.column: 41 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 95, + key.column: 49 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "publicMethod()", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV12publicMethodyyF", + key.line: 97, + key.column: 17, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "internalMethod()", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV14internalMethodyyF", + key.line: 98, + key.column: 10, + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "filePrivateMethod()", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV17filePrivateMethodyyF", + key.line: 99, + key.column: 22, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "privateMethod()", + key.usr: "s:28index_effective_access_level18ScopeReducerStruct33_2295DDF1454D6A6D9229E8222CD85214LLV13privateMethodyyF", + key.line: 100, + key.column: 18, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "ScopeKeeperStruct", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV", + key.line: 103, + key.column: 15, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(publicInitializer:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV17publicInitializerACSi_tcfc", + key.line: 104, + key.column: 12, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 104, + key.column: 36 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(internalInitializer:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV19internalInitializerACSi_tcfc", + key.line: 105, + key.column: 5, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 105, + key.column: 31 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(filePrivateInitializer:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV22filePrivateInitializerACSi_tc33_2295DDF1454D6A6D9229E8222CD85214Llfc", + key.line: 106, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 106, + key.column: 46 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(privateInitializer:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV18privateInitializerACSi_tc33_2295DDF1454D6A6D9229E8222CD85214Llfc", + key.line: 107, + key.column: 13, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 107, + key.column: 38 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicProperty", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV14publicPropertySivp", + key.line: 109, + key.column: 16, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV14publicPropertySivg", + key.line: 109, + key.column: 16, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV14publicPropertySivs", + key.line: 109, + key.column: 16, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 109, + key.column: 32 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "internalProperty", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV16internalPropertySivp", + key.line: 110, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV16internalPropertySivg", + key.line: 110, + key.column: 9, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV16internalPropertySivs", + key.line: 110, + key.column: 9, + key.is_implicit: 1 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 110, + key.column: 27 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "filePrivateProperty", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV19filePrivateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivp", + key.line: 111, + key.column: 21, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV19filePrivateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivg", + key.line: 111, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV19filePrivateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivs", + key.line: 111, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 111, + key.column: 42 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "privateProperty", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV15privateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivp", + key.line: 112, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV15privateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivg", + key.line: 112, + key.column: 17, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV15privateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivs", + key.line: 112, + key.column: 17, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 112, + key.column: 34 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicPropertyWithPrivateSetter", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV31publicPropertyWithPrivateSetterSivp", + key.line: 113, + key.column: 29, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV31publicPropertyWithPrivateSetterSivg", + key.line: 113, + key.column: 29, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.setter_access.private + }, + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV31publicPropertyWithPrivateSetterSivs", + key.line: 113, + key.column: 29, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.setter_access.private + }, + { + key.attribute: source.decl.attribute.public + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.setter_access.private + }, + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 113, + key.column: 62 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 115, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 115, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicPropertyWrappedProperty", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV021publicPropertyWrappedI0Sivp", + key.line: 115, + key.column: 39, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV021publicPropertyWrappedI0Sivg", + key.line: 115, + key.column: 39, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV021publicPropertyWrappedI0Sivs", + key.line: 115, + key.column: 39, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 115, + key.column: 70 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 116, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 116, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "internalPropertyWrappedProperty", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV023internalPropertyWrappedI0Sivp", + key.line: 116, + key.column: 32, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV023internalPropertyWrappedI0Sivg", + key.line: 116, + key.column: 32, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV023internalPropertyWrappedI0Sivs", + key.line: 116, + key.column: 32, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 116, + key.column: 65 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 117, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 117, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "filePrivatePropertyWrappedProperty", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV026filePrivatePropertyWrappedJ033_2295DDF1454D6A6D9229E8222CD85214LLSivp", + key.line: 117, + key.column: 44, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV026filePrivatePropertyWrappedJ033_2295DDF1454D6A6D9229E8222CD85214LLSivg", + key.line: 117, + key.column: 44, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV026filePrivatePropertyWrappedJ033_2295DDF1454D6A6D9229E8222CD85214LLSivs", + key.line: 117, + key.column: 44, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 117, + key.column: 80 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 118, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 118, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "privatePropertyWrappedProperty", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV022privatePropertyWrappedI033_2295DDF1454D6A6D9229E8222CD85214LLSivp", + key.line: 118, + key.column: 40, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV022privatePropertyWrappedI033_2295DDF1454D6A6D9229E8222CD85214LLSivg", + key.line: 118, + key.column: 40, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV022privatePropertyWrappedI033_2295DDF1454D6A6D9229E8222CD85214LLSivs", + key.line: 118, + key.column: 40, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 118, + key.column: 72 + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructVyS2icip", + key.line: 120, + key.column: 12, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructVyS2icig", + key.line: 120, + key.column: 51 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 120, + key.column: 39 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 120, + key.column: 47 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructVXeip", + key.line: 121, + key.column: 5, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructVXeig", + key.line: 121, + key.column: 46 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 121, + key.column: 34 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 121, + key.column: 42 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructVXe33_2295DDF1454D6A6D9229E8222CD85214Llip", + key.line: 122, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructVXe33_2295DDF1454D6A6D9229E8222CD85214Llig", + key.line: 122, + key.column: 61 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 122, + key.column: 49 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 122, + key.column: 57 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructVXe33_2295DDF1454D6A6D9229E8222CD85214Llip", + key.line: 123, + key.column: 13, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructVXe33_2295DDF1454D6A6D9229E8222CD85214Llig", + key.line: 123, + key.column: 53 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 123, + key.column: 41 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 123, + key.column: 49 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "publicMethod()", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV12publicMethodyyF", + key.line: 125, + key.column: 17, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "internalMethod()", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV14internalMethodyyF", + key.line: 126, + key.column: 10, + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "filePrivateMethod()", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV17filePrivateMethod33_2295DDF1454D6A6D9229E8222CD85214LLyyF", + key.line: 127, + key.column: 22, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "privateMethod()", + key.usr: "s:28index_effective_access_level17ScopeKeeperStructV13privateMethod33_2295DDF1454D6A6D9229E8222CD85214LLyyF", + key.line: 128, + key.column: 18, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "PartialScopeReducerStruct", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV", + key.line: 131, + key.column: 8, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(publicInitializer:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV17publicInitializerACSi_tcfc", + key.line: 132, + key.column: 12, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 132, + key.column: 36 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(internalInitializer:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV19internalInitializerACSi_tcfc", + key.line: 133, + key.column: 5, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 133, + key.column: 31 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(filePrivateInitializer:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV22filePrivateInitializerACSi_tc33_2295DDF1454D6A6D9229E8222CD85214Llfc", + key.line: 134, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 134, + key.column: 46 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(privateInitializer:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV18privateInitializerACSi_tc33_2295DDF1454D6A6D9229E8222CD85214Llfc", + key.line: 135, + key.column: 13, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 135, + key.column: 38 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicProperty", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV14publicPropertySivp", + key.line: 137, + key.column: 16, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV14publicPropertySivg", + key.line: 137, + key.column: 16, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV14publicPropertySivs", + key.line: 137, + key.column: 16, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 137, + key.column: 32 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "internalProperty", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV16internalPropertySivp", + key.line: 138, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV16internalPropertySivg", + key.line: 138, + key.column: 9, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV16internalPropertySivs", + key.line: 138, + key.column: 9, + key.is_implicit: 1 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 138, + key.column: 27 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "filePrivateProperty", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV19filePrivateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivp", + key.line: 139, + key.column: 21, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV19filePrivateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivg", + key.line: 139, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV19filePrivateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivs", + key.line: 139, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 139, + key.column: 42 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "privateProperty", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV15privateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivp", + key.line: 140, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV15privateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivg", + key.line: 140, + key.column: 17, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV15privateProperty33_2295DDF1454D6A6D9229E8222CD85214LLSivs", + key.line: 140, + key.column: 17, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 140, + key.column: 34 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicPropertyWithPrivateSetter", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV31publicPropertyWithPrivateSetterSivp", + key.line: 141, + key.column: 29, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV31publicPropertyWithPrivateSetterSivg", + key.line: 141, + key.column: 29, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.setter_access.private + }, + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV31publicPropertyWithPrivateSetterSivs", + key.line: 141, + key.column: 29, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.setter_access.private + }, + { + key.attribute: source.decl.attribute.public + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.setter_access.private + }, + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 141, + key.column: 62 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 143, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 143, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicPropertyWrappedProperty", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV021publicPropertyWrappedJ0Sivp", + key.line: 143, + key.column: 39, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV021publicPropertyWrappedJ0Sivg", + key.line: 143, + key.column: 39, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV021publicPropertyWrappedJ0Sivs", + key.line: 143, + key.column: 39, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + }, + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 143, + key.column: 70 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 144, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 144, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "internalPropertyWrappedProperty", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV023internalPropertyWrappedJ0Sivp", + key.line: 144, + key.column: 32, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV023internalPropertyWrappedJ0Sivg", + key.line: 144, + key.column: 32, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV023internalPropertyWrappedJ0Sivs", + key.line: 144, + key.column: 32, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 144, + key.column: 65 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 145, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 145, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "filePrivatePropertyWrappedProperty", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV026filePrivatePropertyWrappedK033_2295DDF1454D6A6D9229E8222CD85214LLSivp", + key.line: 145, + key.column: 44, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV026filePrivatePropertyWrappedK033_2295DDF1454D6A6D9229E8222CD85214LLSivg", + key.line: 145, + key.column: 44, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV026filePrivatePropertyWrappedK033_2295DDF1454D6A6D9229E8222CD85214LLSivs", + key.line: 145, + key.column: 44, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + }, + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 145, + key.column: 80 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "PublicPropertyWrapper", + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV", + key.line: 146, + key.column: 6 + }, + { + key.kind: source.lang.swift.ref.function.constructor, + key.usr: "s:28index_effective_access_level21PublicPropertyWrapperV12wrappedValueACyxGx_tcfc", + key.line: 146, + key.column: 6, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "privatePropertyWrappedProperty", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV022privatePropertyWrappedJ033_2295DDF1454D6A6D9229E8222CD85214LLSivp", + key.line: 146, + key.column: 40, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV022privatePropertyWrappedJ033_2295DDF1454D6A6D9229E8222CD85214LLSivg", + key.line: 146, + key.column: 40, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute._custom + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV022privatePropertyWrappedJ033_2295DDF1454D6A6D9229E8222CD85214LLSivs", + key.line: 146, + key.column: 40, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute._custom + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + }, + { + key.attribute: source.decl.attribute._custom + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 146, + key.column: 72 + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructVyS2icip", + key.line: 148, + key.column: 12, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructVyS2icig", + key.line: 148, + key.column: 51 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 148, + key.column: 39 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 148, + key.column: 47 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructVXeip", + key.line: 149, + key.column: 5, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructVXeig", + key.line: 149, + key.column: 46 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 149, + key.column: 34 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 149, + key.column: 42 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructVXe33_2295DDF1454D6A6D9229E8222CD85214Llip", + key.line: 150, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructVXe33_2295DDF1454D6A6D9229E8222CD85214Llig", + key.line: 150, + key.column: 61 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 150, + key.column: 49 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 150, + key.column: 57 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.subscript, + key.name: "subscript(_:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructVXe33_2295DDF1454D6A6D9229E8222CD85214Llip", + key.line: 151, + key.column: 13, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:subscript(_:)", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructVXe33_2295DDF1454D6A6D9229E8222CD85214Llig", + key.line: 151, + key.column: 53 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 151, + key.column: 41 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 151, + key.column: 49 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "publicMethod()", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV12publicMethodyyF", + key.line: 153, + key.column: 17, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "internalMethod()", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV14internalMethodyyF", + key.line: 154, + key.column: 10, + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "filePrivateMethod()", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV17filePrivateMethod33_2295DDF1454D6A6D9229E8222CD85214LLyyF", + key.line: 155, + key.column: 22, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "privateMethod()", + key.usr: "s:28index_effective_access_level25PartialScopeReducerStructV13privateMethod33_2295DDF1454D6A6D9229E8222CD85214LLyyF", + key.line: 156, + key.column: 18, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.extension.enum, + key.name: "PrivateEnum", + key.usr: "s:e:s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO017privateMethodFromE9ExtensionyyF", + key.line: 159, + key.column: 19, + key.entities: [ + { + key.kind: source.lang.swift.ref.enum, + key.name: "PrivateEnum", + key.usr: "s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO", + key.line: 159, + key.column: 19 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "privateMethodFromPrivateExtension()", + key.usr: "s:28index_effective_access_level11PrivateEnum33_2295DDF1454D6A6D9229E8222CD85214LLO017privateMethodFromE9ExtensionyyF", + key.line: 160, + key.column: 18, + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ] + }, + { + key.kind: source.lang.swift.decl.protocol, + key.name: "PublicProtocol", + key.usr: "s:28index_effective_access_level14PublicProtocolP", + key.line: 163, + key.column: 17, + key.entities: [ + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "member", + key.usr: "s:28index_effective_access_level14PublicProtocolP6memberSivp", + key.line: 164, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:member", + key.usr: "s:28index_effective_access_level14PublicProtocolP6memberSivg", + key.line: 164, + key.column: 23, + key.is_dynamic: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.name: "setter:member", + key.usr: "s:28index_effective_access_level14PublicProtocolP6memberSivs", + key.line: 164, + key.column: 27, + key.is_dynamic: 1 + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 164, + key.column: 17 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "method()", + key.usr: "s:28index_effective_access_level14PublicProtocolP6methodyyF", + key.line: 165, + key.column: 10, + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.public + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.protocol, + key.name: "InternalProtocol", + key.usr: "s:28index_effective_access_level16InternalProtocolP", + key.line: 168, + key.column: 10, + key.entities: [ + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "member", + key.usr: "s:28index_effective_access_level16InternalProtocolP6memberSivp", + key.line: 169, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:member", + key.usr: "s:28index_effective_access_level16InternalProtocolP6memberSivg", + key.line: 169, + key.column: 23, + key.is_dynamic: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.name: "setter:member", + key.usr: "s:28index_effective_access_level16InternalProtocolP6memberSivs", + key.line: 169, + key.column: 27, + key.is_dynamic: 1 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 169, + key.column: 17 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "method()", + key.usr: "s:28index_effective_access_level16InternalProtocolP6methodyyF", + key.line: 170, + key.column: 10, + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.internal + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.protocol, + key.name: "FilePrivateProtocol", + key.usr: "s:28index_effective_access_level19FilePrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP", + key.line: 173, + key.column: 22, + key.entities: [ + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "member", + key.usr: "s:28index_effective_access_level19FilePrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP6memberSivp", + key.line: 174, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:member", + key.usr: "s:28index_effective_access_level19FilePrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP6memberSivg", + key.line: 174, + key.column: 23, + key.is_dynamic: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.name: "setter:member", + key.usr: "s:28index_effective_access_level19FilePrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP6memberSivs", + key.line: 174, + key.column: 27, + key.is_dynamic: 1 + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 174, + key.column: 17 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "method()", + key.usr: "s:28index_effective_access_level19FilePrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP6methodyyF", + key.line: 175, + key.column: 10, + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.protocol, + key.name: "PrivateProtocol", + key.usr: "s:28index_effective_access_level15PrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP", + key.line: 178, + key.column: 18, + key.entities: [ + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "member", + key.usr: "s:28index_effective_access_level15PrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP6memberSivp", + key.line: 179, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:member", + key.usr: "s:28index_effective_access_level15PrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP6memberSivg", + key.line: 179, + key.column: 23, + key.is_dynamic: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.name: "setter:member", + key.usr: "s:28index_effective_access_level15PrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP6memberSivs", + key.line: 179, + key.column: 27, + key.is_dynamic: 1 + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 179, + key.column: 17 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "method()", + key.usr: "s:28index_effective_access_level15PrivateProtocol33_2295DDF1454D6A6D9229E8222CD85214LLP6methodyyF", + key.line: 180, + key.column: 10, + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.private + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "FilePrivateImplementationOfPublicProtocol", + key.usr: "s:28index_effective_access_level41FilePrivateImplementationOfPublicProtocol33_2295DDF1454D6A6D9229E8222CD85214LLV", + key.line: 183, + key.column: 20, + key.related: [ + { + key.kind: source.lang.swift.ref.protocol, + key.name: "PublicProtocol", + key.usr: "s:28index_effective_access_level14PublicProtocolP", + key.line: 183, + key.column: 63 + } + ], + key.entities: [ + { + key.kind: source.lang.swift.ref.protocol, + key.name: "PublicProtocol", + key.usr: "s:28index_effective_access_level14PublicProtocolP", + key.line: 183, + key.column: 63 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "member", + key.usr: "s:28index_effective_access_level41FilePrivateImplementationOfPublicProtocol33_2295DDF1454D6A6D9229E8222CD85214LLV6memberSivp", + key.line: 184, + key.column: 21, + key.related: [ + { + key.kind: source.lang.swift.ref.var.instance, + key.name: "member", + key.usr: "s:28index_effective_access_level14PublicProtocolP6memberSivp" + } + ], + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level41FilePrivateImplementationOfPublicProtocol33_2295DDF1454D6A6D9229E8222CD85214LLV6memberSivg", + key.line: 184, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level41FilePrivateImplementationOfPublicProtocol33_2295DDF1454D6A6D9229E8222CD85214LLV6memberSivs", + key.line: 184, + key.column: 21, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 184, + key.column: 29 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "method()", + key.usr: "s:28index_effective_access_level41FilePrivateImplementationOfPublicProtocol33_2295DDF1454D6A6D9229E8222CD85214LLV6methodyyF", + key.line: 185, + key.column: 22, + key.related: [ + { + key.kind: source.lang.swift.ref.function.method.instance, + key.name: "method()", + key.usr: "s:28index_effective_access_level14PublicProtocolP6methodyyF" + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.usr: "s:28index_effective_access_level41FilePrivateImplementationOfPublicProtocol33_2295DDF1454D6A6D9229E8222CD85214LLV6memberADSi_tcfc", + key.line: 183, + key.column: 20, + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.usr: "s:28index_effective_access_level41FilePrivateImplementationOfPublicProtocol33_2295DDF1454D6A6D9229E8222CD85214LLVADycfc", + key.line: 183, + key.column: 20, + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.fileprivate + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.fileprivate + } + ], + key.effective_access: source.decl.effective_access.fileprivate + }, + { + key.kind: source.lang.swift.decl.class, + key.name: "OpenClass", + key.usr: "s:28index_effective_access_level9OpenClassC", + key.line: 188, + key.column: 12, + key.entities: [ + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "openProperty", + key.usr: "s:28index_effective_access_level9OpenClassC12openPropertySivp", + key.line: 189, + key.column: 14, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:openProperty", + key.usr: "s:28index_effective_access_level9OpenClassC12openPropertySivg", + key.line: 189, + key.column: 32, + key.is_dynamic: 1 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.open + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 189, + key.column: 28 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "publicProperty", + key.usr: "s:28index_effective_access_level9OpenClassC14publicPropertySivp", + key.line: 190, + key.column: 16, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:publicProperty", + key.usr: "s:28index_effective_access_level9OpenClassC14publicPropertySivg", + key.line: 190, + key.column: 36, + key.is_dynamic: 1 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 190, + key.column: 32 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "internalProperty", + key.usr: "s:28index_effective_access_level9OpenClassC16internalPropertySivp", + key.line: 191, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.name: "getter:internalProperty", + key.usr: "s:28index_effective_access_level9OpenClassC16internalPropertySivg", + key.line: 191, + key.column: 31, + key.is_dynamic: 1 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 191, + key.column: 27 + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "openMethod()", + key.usr: "s:28index_effective_access_level9OpenClassC10openMethodyyF", + key.line: 193, + key.column: 15, + key.is_dynamic: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.open + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "publicMethod()", + key.usr: "s:28index_effective_access_level9OpenClassC12publicMethodyyF", + key.line: 194, + key.column: 17, + key.is_dynamic: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "internalMethod()", + key.usr: "s:28index_effective_access_level9OpenClassC14internalMethodyyF", + key.line: 195, + key.column: 10, + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.usr: "s:28index_effective_access_level9OpenClassCACycfc", + key.line: 188, + key.column: 12, + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.open + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.ref.module, + key.name: "Module", + key.usr: "c:@M@Module", + key.line: 198, + key.column: 8 + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "InternalStruct", + key.usr: "s:28index_effective_access_level14InternalStructV", + key.line: 200, + key.column: 8, + key.entities: [ + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "propertyReferencingPublicClassFromModule", + key.usr: "s:28index_effective_access_level14InternalStructV40propertyReferencingPublicClassFromModule0L00lJ0Cvp", + key.line: 201, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level14InternalStructV40propertyReferencingPublicClassFromModule0L00lJ0Cvg", + key.line: 201, + key.column: 9, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level14InternalStructV40propertyReferencingPublicClassFromModule0L00lJ0Cvs", + key.line: 201, + key.column: 9, + key.is_implicit: 1 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.module, + key.name: "Module", + key.usr: "c:@M@Module", + key.line: 201, + key.column: 51 + }, + { + key.kind: source.lang.swift.ref.class, + key.name: "ModuleClass", + key.usr: "s:6Module0A5ClassC", + key.line: 201, + key.column: 58 + }, + { + key.kind: source.lang.swift.decl.var.instance, + key.name: "propertyReferencingPublicClassFromExportedModule", + key.usr: "s:28index_effective_access_level14InternalStructV48propertyReferencingPublicClassFromExportedModule0L00lJ0Cvp", + key.line: 202, + key.column: 9, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level14InternalStructV48propertyReferencingPublicClassFromExportedModule0L00lJ0Cvg", + key.line: 202, + key.column: 9, + key.is_implicit: 1 + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level14InternalStructV48propertyReferencingPublicClassFromExportedModule0L00lJ0Cvs", + key.line: 202, + key.column: 9, + key.is_implicit: 1 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.ref.module, + key.name: "Exported", + key.usr: "c:@M@Exported", + key.line: 202, + key.column: 59 + }, + { + key.kind: source.lang.swift.ref.class, + key.name: "ExportedClass", + key.usr: "s:8Exported0A5ClassC", + key.line: 202, + key.column: 68 + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.usr: "s:28index_effective_access_level14InternalStructV40propertyReferencingPublicClassFromModule0ghijk8ExportedL0AC0L00lJ0C_0M00mJ0Ctcfc", + key.line: 200, + key.column: 8, + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.typealias, + key.name: "Alias", + key.usr: "s:28index_effective_access_level5Aliasa", + key.line: 205, + key.column: 18, + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 205, + key.column: 26 + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.decl.var.global, + key.name: "globalVariable", + key.usr: "s:28index_effective_access_level14globalVariableSivp", + key.line: 207, + key.column: 12, + key.entities: [ + { + key.kind: source.lang.swift.decl.function.accessor.getter, + key.usr: "s:28index_effective_access_level14globalVariableSivg", + key.line: 207, + key.column: 12, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + }, + { + key.kind: source.lang.swift.decl.function.accessor.setter, + key.usr: "s:28index_effective_access_level14globalVariableSivs", + key.line: 207, + key.column: 12, + key.is_implicit: 1, + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ] + } + ], + key.attributes: [ + { + key.attribute: source.decl.attribute.public + } + ], + key.effective_access: source.decl.effective_access.public + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 207, + key.column: 28 + }, + { + key.kind: source.lang.swift.decl.protocol, + key.name: "ProtocolWithAssociatedType", + key.usr: "s:28index_effective_access_level26ProtocolWithAssociatedTypeP", + key.line: 209, + key.column: 10, + key.entities: [ + { + key.kind: source.lang.swift.decl.associatedtype, + key.name: "T", + key.usr: "s:28index_effective_access_level26ProtocolWithAssociatedTypeP1TQa", + key.line: 210, + key.column: 20, + key.effective_access: source.decl.effective_access.internal + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.struct, + key.name: "ProtocolWithAssociatedTypeImpl", + key.usr: "s:28index_effective_access_level30ProtocolWithAssociatedTypeImplV", + key.line: 213, + key.column: 8, + key.related: [ + { + key.kind: source.lang.swift.ref.protocol, + key.name: "ProtocolWithAssociatedType", + key.usr: "s:28index_effective_access_level26ProtocolWithAssociatedTypeP", + key.line: 213, + key.column: 40 + } + ], + key.entities: [ + { + key.kind: source.lang.swift.ref.protocol, + key.name: "ProtocolWithAssociatedType", + key.usr: "s:28index_effective_access_level26ProtocolWithAssociatedTypeP", + key.line: 213, + key.column: 40 + }, + { + key.kind: source.lang.swift.decl.typealias, + key.name: "T", + key.usr: "s:28index_effective_access_level30ProtocolWithAssociatedTypeImplV1Ta", + key.line: 214, + key.column: 15, + key.related: [ + { + key.kind: source.lang.swift.ref.associatedtype, + key.name: "T", + key.usr: "s:28index_effective_access_level26ProtocolWithAssociatedTypeP1TQa" + } + ], + key.entities: [ + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int", + key.usr: "s:Si", + key.line: 214, + key.column: 19 + } + ], + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.method.instance, + key.name: "testLocalContent()", + key.usr: "s:28index_effective_access_level30ProtocolWithAssociatedTypeImplV16testLocalContentyyF", + key.line: 215, + key.column: 10, + key.effective_access: source.decl.effective_access.internal + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.usr: "s:28index_effective_access_level30ProtocolWithAssociatedTypeImplVACycfc", + key.line: 213, + key.column: 8, + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal + } + ], + key.effective_access: source.decl.effective_access.internal + } + ] +} diff --git a/test/SourceKit/Indexing/index_enum_case.swift.response b/test/SourceKit/Indexing/index_enum_case.swift.response index 7e85204ca105b..a5a53d1769c51 100644 --- a/test/SourceKit/Indexing/index_enum_case.swift.response +++ b/test/SourceKit/Indexing/index_enum_case.swift.response @@ -20,7 +20,8 @@ key.name: "one", key.usr: "s:15index_enum_case1EO3oneyA2CmF", key.line: 6, - key.column: 10 + key.column: 10, + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.enumelement, @@ -36,14 +37,16 @@ key.line: 6, key.column: 22 } - ] + ], + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.enumelement, key.name: "three", key.usr: "s:15index_enum_case1EO5threeyA2CmF", key.line: 6, - key.column: 31 + key.column: 31, + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.var.instance, @@ -82,7 +85,8 @@ } ] } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -96,7 +100,8 @@ { key.attribute: source.decl.attribute.public } - ] + ], + key.effective_access: source.decl.effective_access.public }, { key.kind: source.lang.swift.decl.var.global, @@ -119,7 +124,8 @@ key.column: 5, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.enum, @@ -156,7 +162,8 @@ key.line: 28, key.column: 12 } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/index_forbid_typecheck.swift.response b/test/SourceKit/Indexing/index_forbid_typecheck.swift.response index 3417ee82d5690..935c7a75acc93 100644 --- a/test/SourceKit/Indexing/index_forbid_typecheck.swift.response +++ b/test/SourceKit/Indexing/index_forbid_typecheck.swift.response @@ -29,7 +29,8 @@ key.column: 5, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.var.global, @@ -93,7 +94,8 @@ } ] } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/index_func_import.swift.response b/test/SourceKit/Indexing/index_func_import.swift.response index abfae5f82e293..d2746122538ab 100644 --- a/test/SourceKit/Indexing/index_func_import.swift.response +++ b/test/SourceKit/Indexing/index_func_import.swift.response @@ -63,7 +63,8 @@ key.line: 10, key.column: 3 } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/index_is_test_candidate.swift.response b/test/SourceKit/Indexing/index_is_test_candidate.swift.response index 56b0ab8bf1ca4..5be0064ed2945 100644 --- a/test/SourceKit/Indexing/index_is_test_candidate.swift.response +++ b/test/SourceKit/Indexing/index_is_test_candidate.swift.response @@ -13,7 +13,8 @@ key.name: "test_takesNoParams_andReturnsVoid_butIsNotAnInstanceMethod()", key.usr: "s:23index_is_test_candidate0C54_takesNoParams_andReturnsVoid_butIsNotAnInstanceMethodyyF", key.line: 10, - key.column: 6 + key.column: 6, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.struct, @@ -27,16 +28,19 @@ key.name: "test_startsWithTest_takesNoParams_returnsVoid_butIsDefinedOnAStruct()", key.usr: "s:23index_is_test_candidate8MyStructV0C63_startsWithTest_takesNoParams_returnsVoid_butIsDefinedOnAStructyyF", key.line: 13, - key.column: 8 + key.column: 8, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: "s:23index_is_test_candidate8MyStructVACycfc", key.line: 12, key.column: 8, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -50,9 +54,11 @@ key.usr: "s:23index_is_test_candidate10XCTestCaseCACycfc", key.line: 15, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -83,7 +89,8 @@ key.usr: "s:23index_is_test_candidate14MyPrivateClass33_E06F4E7BC5F577AB6E2EC6D3ECA1C8B9LLC0c47_startsWithTest_takesNoParams_returnsVoid_butIsF0yyF", key.line: 17, key.column: 8, - key.is_dynamic: 1 + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.fileprivate }, { key.kind: source.lang.swift.decl.function.constructor, @@ -102,7 +109,8 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.fileprivate } ], key.attributes: [ @@ -110,7 +118,8 @@ key.attribute: source.decl.attribute.private } ], - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.fileprivate }, { key.kind: source.lang.swift.decl.class, @@ -141,7 +150,8 @@ key.usr: "s:23index_is_test_candidate7MyClassC20doesNotStartWithTestyyF", key.line: 21, key.column: 8, - key.is_dynamic: 1 + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -158,7 +168,8 @@ key.line: 22, key.column: 50 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -175,7 +186,8 @@ key.line: 23, key.column: 68 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -188,7 +200,8 @@ { key.attribute: source.decl.attribute.private } - ] + ], + key.effective_access: source.decl.effective_access.less_than_fileprivate }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -197,7 +210,8 @@ key.line: 25, key.column: 8, key.is_dynamic: 1, - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -206,7 +220,8 @@ key.line: 26, key.column: 8, key.is_dynamic: 1, - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, @@ -225,7 +240,8 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.internal } ], key.attributes: [ @@ -233,7 +249,8 @@ key.attribute: source.decl.attribute.public } ], - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.public } ] } diff --git a/test/SourceKit/Indexing/index_is_test_candidate_objc.swift.response b/test/SourceKit/Indexing/index_is_test_candidate_objc.swift.response index 787cc50b45388..c6a988f0ff967 100644 --- a/test/SourceKit/Indexing/index_is_test_candidate_objc.swift.response +++ b/test/SourceKit/Indexing/index_is_test_candidate_objc.swift.response @@ -13,7 +13,8 @@ key.name: "test_takesNoParams_andReturnsVoid_butIsNotAnInstanceMethod()", key.usr: "s:28index_is_test_candidate_objc0C54_takesNoParams_andReturnsVoid_butIsNotAnInstanceMethodyyF", key.line: 9, - key.column: 6 + key.column: 6, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.struct, @@ -27,16 +28,19 @@ key.name: "test_startsWithTest_takesNoParams_returnsVoid_butIsDefinedOnAStruct()", key.usr: "s:28index_is_test_candidate_objc8MyStructV0C63_startsWithTest_takesNoParams_returnsVoid_butIsDefinedOnAStructyyF", key.line: 12, - key.column: 8 + key.column: 8, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: "s:28index_is_test_candidate_objc8MyStructVACycfc", key.line: 11, key.column: 8, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -50,9 +54,11 @@ key.usr: "s:28index_is_test_candidate_objc10XCTestCaseCACycfc", key.line: 14, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -84,7 +90,8 @@ key.line: 16, key.column: 8, key.is_dynamic: 1, - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.fileprivate }, { key.kind: source.lang.swift.decl.function.constructor, @@ -103,7 +110,8 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.fileprivate } ], key.attributes: [ @@ -111,7 +119,8 @@ key.attribute: source.decl.attribute.private } ], - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.fileprivate }, { key.kind: source.lang.swift.decl.class, @@ -142,7 +151,8 @@ key.usr: "s:28index_is_test_candidate_objc7MyClassC20doesNotStartWithTestyyF", key.line: 20, key.column: 8, - key.is_dynamic: 1 + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -159,7 +169,8 @@ key.line: 21, key.column: 50 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -176,7 +187,8 @@ key.line: 22, key.column: 68 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -190,7 +202,8 @@ key.attribute: source.decl.attribute.private } ], - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.less_than_fileprivate }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -199,7 +212,8 @@ key.line: 24, key.column: 8, key.is_dynamic: 1, - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -208,7 +222,8 @@ key.line: 25, key.column: 8, key.is_dynamic: 1, - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, @@ -227,7 +242,8 @@ { key.attribute: source.decl.attribute.override } - ] + ], + key.effective_access: source.decl.effective_access.internal } ], key.attributes: [ @@ -235,7 +251,8 @@ key.attribute: source.decl.attribute.public } ], - key.is_test_candidate: 1 + key.is_test_candidate: 1, + key.effective_access: source.decl.effective_access.public } ] } diff --git a/test/SourceKit/Indexing/index_objcMembers.swift.response b/test/SourceKit/Indexing/index_objcMembers.swift.response index a75108f1f1995..ce2578223cde7 100644 --- a/test/SourceKit/Indexing/index_objcMembers.swift.response +++ b/test/SourceKit/Indexing/index_objcMembers.swift.response @@ -38,7 +38,8 @@ key.is_dynamic: 1, key.is_implicit: 1 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.ref.struct, @@ -58,7 +59,8 @@ { key.attribute: source.decl.attribute.objc } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, @@ -70,14 +72,16 @@ { key.attribute: source.decl.attribute.objc } - ] + ], + key.effective_access: source.decl.effective_access.internal } ], key.attributes: [ { key.attribute: source.decl.attribute.objcMembers } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/index_operators.swift.response b/test/SourceKit/Indexing/index_operators.swift.response index 20027550b270d..0f528bb5faec0 100644 --- a/test/SourceKit/Indexing/index_operators.swift.response +++ b/test/SourceKit/Indexing/index_operators.swift.response @@ -20,9 +20,11 @@ key.name: "init()", key.usr: "s:15index_operators6ClassACACycfc", key.line: 5, - key.column: 5 + key.column: 5, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.operator.infix, @@ -52,7 +54,8 @@ key.line: 8, key.column: 37 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.struct, @@ -111,7 +114,8 @@ key.column: 19, key.receiver_usr: "s:15index_operators7StructBV" } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.operator.infix, @@ -146,16 +150,19 @@ { key.attribute: source.decl.attribute.public } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: "s:15index_operators7StructBVACycfc", key.line: 12, key.column: 8, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/rdar_21602898.swift.response b/test/SourceKit/Indexing/rdar_21602898.swift.response index 92cab6155bada..85493ddd51e88 100644 --- a/test/SourceKit/Indexing/rdar_21602898.swift.response +++ b/test/SourceKit/Indexing/rdar_21602898.swift.response @@ -13,7 +13,8 @@ key.name: "P", key.usr: "s:13rdar_216028981PP", key.line: 4, - key.column: 10 + key.column: 10, + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.class, @@ -64,9 +65,11 @@ key.usr: "s:13rdar_216028981CCACycfc", key.line: 5, key.column: 7, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SourceKit/Indexing/sr_3815.swift.response b/test/SourceKit/Indexing/sr_3815.swift.response index 5100a76945673..77ac159b14d65 100644 --- a/test/SourceKit/Indexing/sr_3815.swift.response +++ b/test/SourceKit/Indexing/sr_3815.swift.response @@ -29,7 +29,8 @@ key.line: 5, key.column: 21 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -37,9 +38,11 @@ key.usr: "s:7sr_38151PP1fyyF", key.line: 6, key.column: 8, - key.is_dynamic: 1 + key.is_dynamic: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.struct, @@ -78,7 +81,8 @@ key.line: 10, key.column: 21 } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.method.instance, @@ -92,16 +96,19 @@ key.name: "f()", key.usr: "s:7sr_38151PP1fyyF" } - ] + ], + key.effective_access: source.decl.effective_access.internal }, { key.kind: source.lang.swift.decl.function.constructor, key.usr: "s:7sr_38151SVACycfc", key.line: 9, key.column: 8, - key.is_implicit: 1 + key.is_implicit: 1, + key.effective_access: source.decl.effective_access.internal } - ] + ], + key.effective_access: source.decl.effective_access.internal } ] } diff --git a/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/DeprecatedReplaced.swift b/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/DeprecatedReplaced.swift index 0c63463dcda8c..0b6c04eba5a04 100644 --- a/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/DeprecatedReplaced.swift +++ b/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/DeprecatedReplaced.swift @@ -10,7 +10,7 @@ // REQUIRES: OS=macosx -@available(macOS, deprecated: 10.15) +@available(macOS, deprecated: 10.14) public struct S { // LESSTHAN-LABEL: "precise": "s:18DeprecatedReplaced1SV8lessThanyyF", // LESSTHAN: "availability": [ @@ -31,11 +31,11 @@ public struct S { // GREATERTHAN-NEXT: "domain": "macOS", // GREATERTHAN-NEXT: "deprecated": { // GREATERTHAN-NEXT: "major": 10, -// GREATERTHAN-NEXT: "minor": 15 +// GREATERTHAN-NEXT: "minor": 14 // GREATERTHAN-NEXT: } // GREATERTHAN-NEXT: } // GREATERTHAN-NEXT: ] - @available(macOS, deprecated: 10.16) + @available(macOS, deprecated: 10.15) public func greaterThan() {} // EQUAL-LABEL: "precise": "s:18DeprecatedReplaced1SV5equalyyF", @@ -44,15 +44,15 @@ public struct S { // EQUAL-NEXT: "domain": "macOS", // EQUAL-NEXT: "deprecated": { // EQUAL-NEXT: "major": 10, -// EQUAL-NEXT: "minor": 15 +// EQUAL-NEXT: "minor": 14 // EQUAL-NEXT: } // EQUAL-NEXT: } // EQUAL-NEXT: ] - @available(macOS, deprecated: 10.15) + @available(macOS, deprecated: 10.14) public func equal() {} } -@available(macOS, deprecated: 10.15) +@available(macOS, deprecated: 10.14) public struct Outer { public struct Inner { // TRANSITIVELESSTHAN-LABEL: "precise": "s:18DeprecatedReplaced5OuterV5InnerV8lessThanyyF" @@ -74,11 +74,11 @@ public struct Outer { // TRANSITIVEGREATERTHAN-NEXT: "domain": "macOS", // TRANSITIVEGREATERTHAN-NEXT: "deprecated": { // TRANSITIVEGREATERTHAN-NEXT: "major": 10, - // TRANSITIVEGREATERTHAN-NEXT: "minor": 15 + // TRANSITIVEGREATERTHAN-NEXT: "minor": 14 // TRANSITIVEGREATERTHAN-NEXT: } // TRANSITIVEGREATERTHAN-NEXT: } // TRANSITIVEGREATERTHAN-NEXT: ] - @available(macOS, deprecated: 10.16) + @available(macOS, deprecated: 10.15) public func greaterThan() {} // TRANSITIVEEQUAL-LABEL:"precise": "s:18DeprecatedReplaced5OuterV5InnerV5equalyyF" @@ -87,11 +87,11 @@ public struct Outer { // TRANSITIVEEQUAL-NEXT: "domain": "macOS", // TRANSITIVEEQUAL-NEXT: "deprecated": { // TRANSITIVEEQUAL-NEXT: "major": 10, - // TRANSITIVEEQUAL-NEXT: "minor": 15 + // TRANSITIVEEQUAL-NEXT: "minor": 14 // TRANSITIVEEQUAL-NEXT: } // TRANSITIVEEQUAL-NEXT: } // TRANSITIVEEQUAL-NEXT: ] - @available(macOS, deprecated: 10.15) + @available(macOS, deprecated: 10.14) public func equal() {} } } diff --git a/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/IntroducedReplaced.swift b/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/IntroducedReplaced.swift index 79bbf24ca5169..9ff58a173041b 100644 --- a/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/IntroducedReplaced.swift +++ b/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/IntroducedReplaced.swift @@ -8,7 +8,7 @@ // REQUIRES: OS=macosx -@available(macOS, introduced: 10.15) +@available(macOS, introduced: 10.14) public struct S { // Not possible: declarations cannot be more available than an enclosing scope // @available(macOS, introduced: 10.10) @@ -20,11 +20,11 @@ public struct S { // GREATERTHAN-NEXT: "domain": "macOS", // GREATERTHAN-NEXT: "introduced": { // GREATERTHAN-NEXT: "major": 10, - // GREATERTHAN-NEXT: "minor": 16 + // GREATERTHAN-NEXT: "minor": 15 // GREATERTHAN-NEXT: } // GREATERTHAN-NEXT: } // GREATERTHAN-NEXT: ] - @available(macOS, introduced: 10.16) + @available(macOS, introduced: 10.15) public func greaterThan() {} // EQUAL-LABEL: "precise": "s:18IntroducedReplaced1SV5equalyyF", @@ -33,15 +33,15 @@ public struct S { // EQUAL-NEXT: "domain": "macOS", // EQUAL-NEXT: "introduced": { // EQUAL-NEXT: "major": 10, - // EQUAL-NEXT: "minor": 15 + // EQUAL-NEXT: "minor": 14 // EQUAL-NEXT: } // EQUAL-NEXT: } // EQUAL-NEXT: ] - @available(macOS, introduced: 10.15) + @available(macOS, introduced: 10.14) public func equal() {} } -@available(macOS, introduced: 10.15) +@available(macOS, introduced: 10.14) public struct Outer { public struct Inner { // TRANSITIVEGREATERTHAN-LABEL: "precise": "s:18IntroducedReplaced5OuterV5InnerV11greaterThanyyF" @@ -50,11 +50,11 @@ public struct Outer { // TRANSITIVEGREATERTHAN-NEXT: "domain": "macOS", // TRANSITIVEGREATERTHAN-NEXT: "introduced": { // TRANSITIVEGREATERTHAN-NEXT: "major": 10, - // TRANSITIVEGREATERTHAN-NEXT: "minor": 16 + // TRANSITIVEGREATERTHAN-NEXT: "minor": 15 // TRANSITIVEGREATERTHAN-NEXT: } // TRANSITIVEGREATERTHAN-NEXT: } // TRANSITIVEGREATERTHAN-NEXT: ] - @available(macOS, introduced: 10.16) + @available(macOS, introduced: 10.15) public func greaterThan() {} // TRANSITIVEEQUAL-LABEL: precise": "s:18IntroducedReplaced5OuterV5InnerV5equalyyF" @@ -63,11 +63,11 @@ public struct Outer { // TRANSITIVEEQUAL-NEXT: "domain": "macOS", // TRANSITIVEEQUAL-NEXT: "introduced": { // TRANSITIVEEQUAL-NEXT: "major": 10, - // TRANSITIVEEQUAL-NEXT: "minor": 15 + // TRANSITIVEEQUAL-NEXT: "minor": 14 // TRANSITIVEEQUAL-NEXT: } // TRANSITIVEEQUAL-NEXT: } // TRANSITIVEEQUAL-NEXT: ] - @available(macOS, introduced: 10.15) + @available(macOS, introduced: 10.14) public func equal() {} } } diff --git a/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/ObsoletedReplaced.swift b/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/ObsoletedReplaced.swift index 7ac2ebe996032..0674311d40c2f 100644 --- a/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/ObsoletedReplaced.swift +++ b/test/SymbolGraph/Symbols/Mixins/Availability/Inherited/ObsoletedReplaced.swift @@ -10,7 +10,7 @@ // REQUIRES: OS=macosx -@available(macOS, obsoleted: 10.15) +@available(macOS, obsoleted: 10.14) public struct S { // LESSTHAN-LABEL: "precise": "s:17ObsoletedReplaced1SV8lessThanyyF", // LESSTHAN: "availability": [ @@ -31,11 +31,11 @@ public struct S { // GREATERTHAN-NEXT: "domain": "macOS", // GREATERTHAN-NEXT: "obsoleted": { // GREATERTHAN-NEXT: "major": 10, - // GREATERTHAN-NEXT: "minor": 15 + // GREATERTHAN-NEXT: "minor": 14 // GREATERTHAN-NEXT: } // GREATERTHAN-NEXT: } // GREATERTHAN-NEXT: ] - @available(macOS, obsoleted: 10.16) + @available(macOS, obsoleted: 10.15) public func greaterThan() {} // EQUAL-LABEL: "precise": "s:17ObsoletedReplaced1SV5equalyyF", @@ -44,15 +44,15 @@ public struct S { // EQUAL-NEXT: "domain": "macOS", // EQUAL-NEXT: "obsoleted": { // EQUAL-NEXT: "major": 10, - // EQUAL-NEXT: "minor": 15 + // EQUAL-NEXT: "minor": 14 // EQUAL-NEXT: } // EQUAL-NEXT: } // EQUAL-NEXT: ] - @available(macOS, obsoleted: 10.15) + @available(macOS, obsoleted: 10.14) public func equal() {} } -@available(macOS, obsoleted: 10.15) +@available(macOS, obsoleted: 10.14) public struct Outer { public struct Inner { // TRANSITIVELESSTHAN-LABEL: "precise": "s:17ObsoletedReplaced5OuterV5InnerV8lessThanyyF" @@ -74,11 +74,11 @@ public struct Outer { // TRANSITIVEGREATERTHAN-NEXT: "domain": "macOS", // TRANSITIVEGREATERTHAN-NEXT: "obsoleted": { // TRANSITIVEGREATERTHAN-NEXT: "major": 10, - // TRANSITIVEGREATERTHAN-NEXT: "minor": 15 + // TRANSITIVEGREATERTHAN-NEXT: "minor": 14 // TRANSITIVEGREATERTHAN-NEXT: } // TRANSITIVEGREATERTHAN-NEXT: } // TRANSITIVEGREATERTHAN-NEXT: ] - @available(macOS, obsoleted: 10.16) + @available(macOS, obsoleted: 10.15) public func greaterThan() {} // TRANSITIVEEQUAL-LABEL:"precise": "s:17ObsoletedReplaced5OuterV5InnerV5equalyyF" @@ -87,11 +87,11 @@ public struct Outer { // TRANSITIVEEQUAL-NEXT: "domain": "macOS", // TRANSITIVEEQUAL-NEXT: "obsoleted": { // TRANSITIVEEQUAL-NEXT: "major": 10, - // TRANSITIVEEQUAL-NEXT: "minor": 15 + // TRANSITIVEEQUAL-NEXT: "minor": 14 // TRANSITIVEEQUAL-NEXT: } // TRANSITIVEEQUAL-NEXT: } // TRANSITIVEEQUAL-NEXT: ] - @available(macOS, obsoleted: 10.15) + @available(macOS, obsoleted: 10.14) public func equal() {} } } diff --git a/test/Syntax/round_trip_stdlib.swift b/test/Syntax/round_trip_stdlib.swift index ccc214adff588..0d9eac0546e4a 100644 --- a/test/Syntax/round_trip_stdlib.swift +++ b/test/Syntax/round_trip_stdlib.swift @@ -1 +1,3 @@ +// test/Syntax/round_trip_stdlib.swift is very slow on ASAN build +// REQUIRES: no_asan // RUN: %round-trip-syntax-test -d %swift_src_root/stdlib --swift-syntax-test %swift-syntax-test diff --git a/test/expr/closure/inference.swift b/test/expr/closure/inference.swift index a63f5cbe39641..b1b536c53991f 100644 --- a/test/expr/closure/inference.swift +++ b/test/expr/closure/inference.swift @@ -73,3 +73,8 @@ let cc = SR8563 { (_: (Int)) in } cc((1)) // Ok cc(1) // Ok + +// SR-12955 +func SR12955() { + let f: @convention(c) (T) -> Void // expected-error {{cannot find type 'T' in scope}} +} diff --git a/test/lit.cfg b/test/lit.cfg index 81c20d27225ad..eb10093d42f5b 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -311,6 +311,11 @@ if run_vers.endswith('-simulator'): else: run_environment='' +target_arch = run_cpu +if run_os == 'openbsd' and run_cpu == 'amd64': + target_arch = run_cpu + run_cpu = 'x86_64' + run_ptrsize = '64' if ('64' in run_cpu or run_cpu == "s390x") else '32' run_ptrauth = 'ptrauth' if run_cpu == 'arm64e' else 'noptrauth' run_endian = 'little' if run_cpu != 's390x' else 'big' @@ -1625,7 +1630,7 @@ if swift_execution_tests_extra_flags: platform_module_dir = make_path(test_resource_dir, config.target_sdk_name) if run_vendor != 'apple': - platform_module_dir = make_path(platform_module_dir, run_cpu) + platform_module_dir = make_path(platform_module_dir, target_arch) platform_dylib_dir = platform_module_dir if run_os == 'maccatalyst' and config.darwin_maccatalyst_build_flavor == "ios-like": @@ -1873,6 +1878,7 @@ config.substitutions.append(('%xcode-extra-frameworks-dir', extra_frameworks_dir config.substitutions.append(('%target-swiftmodule-name', target_specific_module_triple + '.swiftmodule')) config.substitutions.append(('%target-swiftdoc-name', target_specific_module_triple + '.swiftdoc')) config.substitutions.append(('%target-swiftsourceinfo-name', target_specific_module_triple + '.swiftsourceinfo')) +config.substitutions.append(('%target-swiftinterface-name', target_specific_module_triple + '.swiftinterface')) config.substitutions.append(('%target-object-format', config.target_object_format)) config.substitutions.append(('%{target-shared-library-prefix}', config.target_shared_library_prefix)) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 2ace899dbdcde..8eafc0873899b 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -42,12 +42,6 @@ add_swift_tool_subdirectory(swift-demangle-fuzzer) add_swift_tool_subdirectory(swift-reflection-fuzzer) endif() -if(SWIFT_BUILD_STDLIB AND SWIFT_BUILD_SDK_OVERLAY) - set(BUILD_FOUNDATION TRUE) -else() - set(BUILD_FOUNDATION FALSE) -endif() - if(SWIFT_BUILD_SOURCEKIT) add_swift_tool_subdirectory(SourceKit) endif() diff --git a/tools/SourceKit/include/SourceKit/Core/LangSupport.h b/tools/SourceKit/include/SourceKit/Core/LangSupport.h index a30759b298842..7bfbd371d9e49 100644 --- a/tools/SourceKit/include/SourceKit/Core/LangSupport.h +++ b/tools/SourceKit/include/SourceKit/Core/LangSupport.h @@ -51,6 +51,7 @@ struct EntityInfo { unsigned Line = 0; unsigned Column = 0; ArrayRef Attrs; + Optional EffectiveAccess; EntityInfo() = default; }; diff --git a/tools/SourceKit/lib/SwiftLang/SwiftIndexing.cpp b/tools/SourceKit/lib/SwiftLang/SwiftIndexing.cpp index 42ba21b268786..deff6db7eef8f 100644 --- a/tools/SourceKit/lib/SwiftLang/SwiftIndexing.cpp +++ b/tools/SourceKit/lib/SwiftLang/SwiftIndexing.cpp @@ -134,10 +134,54 @@ class SKIndexDataConsumer : public IndexDataConsumer { if (!isRef) { uidAttrs = getDeclAttributeUIDs(symbol.decl); info.Attrs = uidAttrs; + if (auto *VD = dyn_cast(symbol.decl)) { + if (shouldOutputEffectiveAccessOfValueSymbol(symbol.symInfo)) { + AccessScope accessScope = VD->getFormalAccessScope(); + UIdent AttrUID = SwiftLangSupport::getUIDForFormalAccessScope(accessScope); + info.EffectiveAccess = AttrUID; + } + } } return func(info); } + bool shouldOutputEffectiveAccessOfValueSymbol(SymbolInfo Info) { + SymbolKind Kind = Info.Kind; + SymbolSubKind SubKind = Info.SubKind; + switch (SubKind) { + case SymbolSubKind::AccessorGetter: + case SymbolSubKind::AccessorSetter: + case SymbolSubKind::SwiftAccessorWillSet: + case SymbolSubKind::SwiftAccessorDidSet: + case SymbolSubKind::SwiftAccessorAddressor: + case SymbolSubKind::SwiftAccessorMutableAddressor: + case SymbolSubKind::SwiftGenericTypeParam: + return false; + default: + break; + } + switch (Kind) { + case SymbolKind::Enum: + case SymbolKind::Struct: + case SymbolKind::Class: + case SymbolKind::Protocol: + case SymbolKind::Constructor: + case SymbolKind::EnumConstant: + case SymbolKind::Function: + case SymbolKind::StaticMethod: + case SymbolKind::Variable: + case SymbolKind::InstanceMethod: + case SymbolKind::ClassMethod: + case SymbolKind::InstanceProperty: + case SymbolKind::ClassProperty: + case SymbolKind::StaticProperty: + case SymbolKind::TypeAlias: + return true; + default: + return false; + } + } + template bool withEntityInfo(const IndexRelation &relation, F func) { EntityInfo info; diff --git a/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp b/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp index 8fea7e661c542..f2becfabbef1c 100644 --- a/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp +++ b/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp @@ -82,6 +82,10 @@ static UIdent Attr_Setter_FilePrivate("source.decl.attribute.setter_access.filep static UIdent Attr_Setter_Internal("source.decl.attribute.setter_access.internal"); static UIdent Attr_Setter_Public("source.decl.attribute.setter_access.public"); static UIdent Attr_Setter_Open("source.decl.attribute.setter_access.open"); +static UIdent EffectiveAccess_Public("source.decl.effective_access.public"); +static UIdent EffectiveAccess_Internal("source.decl.effective_access.internal"); +static UIdent EffectiveAccess_FilePrivate("source.decl.effective_access.fileprivate"); +static UIdent EffectiveAccess_LessThanFilePrivate("source.decl.effective_access.less_than_fileprivate"); std::unique_ptr SourceKit::createSwiftLangSupport(SourceKit::Context &SKCtx) { @@ -808,6 +812,20 @@ Optional SwiftLangSupport::getUIDForDeclAttribute(const swift::DeclAttri return None; } +UIdent SwiftLangSupport::getUIDForFormalAccessScope(const swift::AccessScope Scope) { + if (Scope.isPublic()) { + return EffectiveAccess_Public; + } else if (Scope.isInternal()) { + return EffectiveAccess_Internal; + } else if (Scope.isFileScope()) { + return EffectiveAccess_FilePrivate; + } else if (Scope.isPrivate()) { + return EffectiveAccess_LessThanFilePrivate; + } else { + llvm_unreachable("Unsupported access scope"); + } +} + std::vector SwiftLangSupport::UIDsFromDeclAttributes(const DeclAttributes &Attrs) { std::vector AttrUIDs; diff --git a/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.h b/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.h index 54ec93e8cc149..387bde3a2dab7 100644 --- a/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.h +++ b/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.h @@ -383,6 +383,8 @@ class SwiftLangSupport : public LangSupport { static Optional getUIDForDeclAttribute(const swift::DeclAttribute *Attr); + static SourceKit::UIdent getUIDForFormalAccessScope(const swift::AccessScope Scope); + static std::vector UIDsFromDeclAttributes(const swift::DeclAttributes &Attrs); static SourceKit::UIdent getUIDForNameKind(swift::ide::NameKind Kind); diff --git a/tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp b/tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp index 46e4ab3d83012..e388918ef6a49 100644 --- a/tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp +++ b/tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp @@ -1355,6 +1355,9 @@ bool SKIndexingConsumer::startSourceEntity(const EntityInfo &Info) { } } + if (Info.EffectiveAccess) + Elem.set(KeyEffectiveAccess, Info.EffectiveAccess.getValue()); + EntitiesStack.push_back({ Info.Kind, Elem, ResponseBuilder::Array(), ResponseBuilder::Array()}); return true; diff --git a/tools/swift-ide-test/CMakeLists.txt b/tools/swift-ide-test/CMakeLists.txt index 095e97d5f155e..8f9614e8ad144 100644 --- a/tools/swift-ide-test/CMakeLists.txt +++ b/tools/swift-ide-test/CMakeLists.txt @@ -12,7 +12,7 @@ target_link_libraries(swift-ide-test swiftIDE) # If libxml2 is available, make it available for swift-ide-test. -if(LibXml2_FOUND) +if(LLVM_ENABLE_LIBXML2) include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR}) target_link_libraries(swift-ide-test PRIVATE ${LIBXML2_LIBRARIES}) target_compile_definitions(swift-ide-test PRIVATE SWIFT_HAVE_LIBXML=1) diff --git a/tools/swift-inspect/.gitignore b/tools/swift-inspect/.gitignore new file mode 100644 index 0000000000000..f4096fee41368 --- /dev/null +++ b/tools/swift-inspect/.gitignore @@ -0,0 +1 @@ +Package.resolved diff --git a/utils/build-script b/utils/build-script index 4d47122f20c03..47ef2165b7766 100755 --- a/utils/build-script +++ b/utils/build-script @@ -889,6 +889,11 @@ class BuildScriptInvocation(object): # list. if self.args.infer_dependencies: combined = impl_product_classes + product_classes + if self.args.verbose_build: + print("-- Build Graph Inference --") + print("Initial Product List:") + for p in combined: + print(" {}".format(p.product_name())) # Now that we have produced the schedule, resplit. We require our # dependencies to respect our build-script-impl property. This means @@ -908,6 +913,12 @@ class BuildScriptInvocation(object): impl_product_classes.append(p) else: product_classes.append(p) + if self.args.verbose_build: + print("Final Build Order:") + for p in impl_product_classes: + print(" {}".format(p.product_name())) + for p in product_classes: + print(" {}".format(p.product_name())) return (impl_product_classes, product_classes) def execute(self): diff --git a/utils/build_swift/build_swift/defaults.py b/utils/build_swift/build_swift/defaults.py index c864deea795f3..86beac7bb44bb 100644 --- a/utils/build_swift/build_swift/defaults.py +++ b/utils/build_swift/build_swift/defaults.py @@ -121,7 +121,7 @@ def llvm_install_components(): components = ['llvm-cov', 'llvm-profdata', 'IndexStore', 'clang', 'clang-resource-headers', 'compiler-rt', 'clangd'] if os.sys.platform == 'darwin': - components.extend(['llvm-dsymutil']) + components.extend(['dsymutil']) else: components.extend(['lld']) return ';'.join(components) diff --git a/utils/gyb_sourcekit_support/UIDs.py b/utils/gyb_sourcekit_support/UIDs.py index 974544dbbb111..eeed7c7f27ba0 100644 --- a/utils/gyb_sourcekit_support/UIDs.py +++ b/utils/gyb_sourcekit_support/UIDs.py @@ -183,6 +183,7 @@ def __init__(self, internal_name, external_name): 'key.completion_check_dependency_interval'), KEY('AnnotatedTypename', 'key.annotated.typename'), KEY('CompileOperation', 'key.compile_operation'), + KEY('EffectiveAccess', 'key.effective_access'), ] diff --git a/utils/gyb_syntax_support/__init__.py b/utils/gyb_syntax_support/__init__.py index b24c5387b7497..1f58d26dbfe67 100644 --- a/utils/gyb_syntax_support/__init__.py +++ b/utils/gyb_syntax_support/__init__.py @@ -1,3 +1,4 @@ +import hashlib import textwrap from . import Classification # noqa: I201 from . import Token @@ -143,34 +144,34 @@ def dedented_lines(description): return textwrap.dedent(description).split('\n') -def hash_syntax_node(node): +def digest_syntax_node(digest, node): # Hash into the syntax name and serialization code - result = hash((node.name, get_serialization_code(node.syntax_kind))) + digest.update(node.name) + digest.update(str(get_serialization_code(node.syntax_kind))) for child in node.children: # Hash into the expected child syntax - result = hash((result, child.syntax_kind)) + digest.update(child.syntax_kind) # Hash into the child name - result = hash((result, child.name)) + digest.update(child.name) # Hash into whether the child is optional - result = hash((result, child.is_optional)) - return result + digest.update(str(child.is_optional)) -def hash_token_syntax(token): +def digest_syntax_token(digest, token): # Hash into the token name and serialization code - return hash((token.name, token.serialization_code)) + digest.update(token.name) + digest.update(str(token.serialization_code)) -def hash_trivia(trivia): - return hash((trivia.name, trivia.serialization_code, trivia.characters)) +def digest_trivia(digest, trivia): + digest.update(trivia.name) + digest.update(str(trivia.serialization_code)) + digest.update(str(trivia.characters)) def calculate_node_hash(): - result = 0 - for node in SYNTAX_NODES: - result = hash((result, hash_syntax_node(node))) - for token in SYNTAX_TOKENS: - result = hash((result, hash_token_syntax(token))) - for trivia in TRIVIAS: - result = hash((result, hash_trivia(trivia))) - return result + digest = hashlib.sha1() + map(lambda node: digest_syntax_node(digest, node), SYNTAX_NODES) + map(lambda token: digest_syntax_token(digest, token), SYNTAX_TOKENS) + map(lambda trivia: digest_trivia(digest, trivia), TRIVIAS) + return digest.hexdigest() diff --git a/utils/vim/syntax/swift.vim b/utils/vim/syntax/swift.vim index 2928550b4adb8..b3db3dc949e2d 100644 --- a/utils/vim/syntax/swift.vim +++ b/utils/vim/syntax/swift.vim @@ -16,10 +16,11 @@ if exists("b:current_syntax") endif syn keyword swiftKeyword - \ associatedtype \ break + \ case \ catch \ continue + \ default \ defer \ do \ else @@ -38,6 +39,10 @@ syn keyword swiftKeyword syn match swiftMultiwordKeyword \ "indirect case" +syn keyword swiftCoreTypes + \ Any + \ AnyObject + syn keyword swiftImport skipwhite skipempty nextgroup=swiftImportModule \ import @@ -88,10 +93,13 @@ syn keyword swiftTypeDefinition skipwhite skipempty nextgroup=swiftTypeName \ class \ enum \ extension + \ operator + \ precedencegroup \ protocol \ struct syn keyword swiftTypeAliasDefinition skipwhite skipempty nextgroup=swiftTypeAliasName + \ associatedtype \ typealias syn match swiftMultiwordTypeDefinition skipwhite skipempty nextgroup=swiftTypeName @@ -197,7 +205,7 @@ syn match swiftDecimal contained \ /[0-9]\+/ syn match swiftPreproc - \ /#\(\\|\\|\\)/ + \ /#\(\\|\\|\\|\\|\\)/ syn match swiftPreproc \ /^\s*#\(\\|\\|\\|\\|\\|\\)/ syn region swiftPreprocFalse @@ -208,9 +216,9 @@ syn match swiftAttribute syn keyword swiftTodo MARK TODO FIXME contained -syn match swiftCastOp skipwhite skipempty nextgroup=swiftType +syn match swiftCastOp skipwhite skipempty nextgroup=swiftType,swiftCoreTypes \ "\" -syn match swiftCastOp skipwhite skipempty nextgroup=swiftType +syn match swiftCastOp skipwhite skipempty nextgroup=swiftType,swiftCoreTypes \ "\[!?]\?" syn match swiftNilOps @@ -223,6 +231,7 @@ hi def link swiftImport Include hi def link swiftImportModule Title hi def link swiftImportComponent Identifier hi def link swiftKeyword Statement +hi def link swiftCoreTypes Type hi def link swiftMultiwordKeyword Statement hi def link swiftTypeDefinition Define hi def link swiftMultiwordTypeDefinition Define diff --git a/validation-test/BuildSystem/infer_dumps_deps_if_verbose_build.test b/validation-test/BuildSystem/infer_dumps_deps_if_verbose_build.test new file mode 100644 index 0000000000000..0bb88a9672113 --- /dev/null +++ b/validation-test/BuildSystem/infer_dumps_deps_if_verbose_build.test @@ -0,0 +1,26 @@ +# RUN: %empty-directory(%t) +# RUN: mkdir -p %t +# RUN: SWIFT_BUILD_ROOT=%t %swift_src_root/utils/build-script --verbose-build --dry-run --infer --swiftpm --cmake %cmake 2>&1 | %FileCheck %s + +# REQUIRES: standalone_build + +# Just make sure we compute the build graph/emit output. +# +# CHECK: -- Build Graph Inference -- +# CHECK: Initial Product List: +# CHECK: cmark +# CHECK: llvm +# CHECK: swift +# CHECK: Final Build Order: +# CHECK: cmark +# CHECK: llvm +# CHECK: swift + +# Then make sure we are installing/building at the appropriate times. +# +# CHECK: --- Installing cmark --- +# CHECK: --- Installing llvm --- +# CHECK: --- Installing swift --- +# CHECK: --- Installing llbuild --- +# CHECK: --- Building swiftpm --- +# CHECK: --- Installing swiftpm --- diff --git a/validation-test/compiler_crashers_2_fixed/sr12723.swift b/validation-test/compiler_crashers_2_fixed/sr12723.swift new file mode 100644 index 0000000000000..b04103a9f7a8e --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/sr12723.swift @@ -0,0 +1,81 @@ +// RUN: %target-swift-emit-silgen %s -verify + +func SR12723_thin(_: (@convention(thin) () -> Void) -> Void) {} +func SR12723_block(_: (@convention(block) () -> Void) -> Void) {} +func SR12723_c(_: (@convention(c) () -> Void) -> Void) {} + +func SR12723_function(_: () -> Void) {} + +func context() { + SR12723_c(SR12723_function) + + SR12723_block(SR12723_function) + + SR12723_thin(SR12723_function) +} + +struct SR12723_C { + let function: (@convention(c) () -> Void) -> Void +} + +struct SR12723_Thin { + let function: (@convention(thin) () -> Void) -> Void +} + +struct SR12723_Block { + let function: (@convention(block) () -> Void) -> Void +} + +func proxy(_ f: (() -> Void) -> Void) { + let a = 1 + f { print(a) } +} + +func cContext() { + let c = SR12723_C { app in app() } + + proxy(c.function) + // expected-error@-1 {{cannot convert value of type '(@convention(c) () -> Void) -> Void' to expected argument type '(() -> Void) -> Void'}} + + let _ : (@convention(block) () -> Void) -> Void = c.function + // expected-error@-1 {{cannot convert value of type '(@convention(c) () -> Void) -> Void' to specified type '(@convention(block) () -> Void) -> Void'}} + + let _ : (@convention(c) () -> Void) -> Void = c.function // OK + + let _ : (@convention(thin) () -> Void) -> Void = c.function // OK + + let _ : (() -> Void) -> Void = c.function + // expected-error@-1 {{cannot convert value of type '(@convention(c) () -> Void) -> Void' to specified type '(() -> Void) -> Void'}} + +} + +func thinContext() { + let thin = SR12723_Thin { app in app() } + + proxy(thin.function) + // expected-error@-1 {{cannot convert value of type '(@convention(thin) () -> Void) -> Void' to expected argument type '(() -> Void) -> Void'}} + + let _ : (@convention(block) () -> Void) -> Void = thin.function + // expected-error@-1 {{cannot convert value of type '(@convention(thin) () -> Void) -> Void' to specified type '(@convention(block) () -> Void) -> Void'}} + + let _ : (@convention(c) () -> Void) -> Void = thin.function // OK + + let _ : (@convention(thin) () -> Void) -> Void = thin.function // OK + + let _ : (() -> Void) -> Void = thin.function + // expected-error@-1 {{cannot convert value of type '(@convention(thin) () -> Void) -> Void' to specified type '(() -> Void) -> Void'}} +} + +func blockContext() { + let block = SR12723_Block { app in app() } + + proxy(block.function) + + let _ : (@convention(block) () -> Void) -> Void = block.function // OK + + let _ : (@convention(c) () -> Void) -> Void = block.function // OK + + let _ : (@convention(thin) () -> Void) -> Void = block.function // OK + + let _ : (() -> Void) -> Void = block.function // OK +} diff --git a/validation-test/compiler_crashers_2_fixed/sr12990.swift b/validation-test/compiler_crashers_2_fixed/sr12990.swift new file mode 100644 index 0000000000000..d3d68daed1bec --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/sr12990.swift @@ -0,0 +1,11 @@ +// RUN: %target-swift-frontend -typecheck %s -verify + +class ContainerTransition { + var viewControllers: [Int: String]? + func completeTransition() { + viewControllers?[Int//.max + // expected-error@-1 {{no exact matches in call to subscript}} + // expected-note@-2 {{found candidate with type '((Int).Type) -> Dictionary.SubSequence' (aka '(Int.Type) -> Slice>')}} + // expected-note@-3 {{to match this opening '['}} + } // expected-error {{expected ']' in expression list}} +} diff --git a/validation-test/compiler_crashers_2_fixed/sr12998.swift b/validation-test/compiler_crashers_2_fixed/sr12998.swift new file mode 100644 index 0000000000000..d9c32eeb9bd22 --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/sr12998.swift @@ -0,0 +1,19 @@ +// RUN: %target-swift-frontend -typecheck %s -verify + +enum FooString: String { // expected-error {{'FooString' declares raw type 'String', but does not conform to RawRepresentable and conformance could not be synthesized}} + case bar1 = #file // expected-error {{use of '#file' literal as raw value for enum case is not supported}} + case bar2 = #function // expected-error {{use of '#function' literal as raw value for enum case is not supported}} + case bar3 = #filePath // expected-error {{use of '#filePath' literal as raw value for enum case is not supported}} + case bar4 = #line // expected-error {{cannot convert value of type 'Int' to raw type 'String'}} + case bar5 = #column // expected-error {{cannot convert value of type 'Int' to raw type 'String'}} + case bar6 = #dsohandle // expected-error {{cannot convert value of type 'UnsafeRawPointer' to raw type 'String'}} +} + +enum FooInt: Int { // expected-error {{'FooInt' declares raw type 'Int', but does not conform to RawRepresentable and conformance could not be synthesized}} + case bar1 = #file // expected-error {{cannot convert value of type 'String' to raw type 'Int'}} + case bar2 = #function // expected-error {{cannot convert value of type 'String' to raw type 'Int'}} + case bar3 = #filePath // expected-error {{cannot convert value of type 'String' to raw type 'Int'}} + case bar4 = #line // expected-error {{use of '#line' literal as raw value for enum case is not supported}} + case bar5 = #column // expected-error {{use of '#column' literal as raw value for enum case is not supported}} + case bar6 = #dsohandle // expected-error {{cannot convert value of type 'UnsafeRawPointer' to raw type 'Int'}} +}