diff --git a/docs/WindowsBuild.md b/docs/WindowsBuild.md index 86ddaf91be1fb..0ca8b656501ff 100644 --- a/docs/WindowsBuild.md +++ b/docs/WindowsBuild.md @@ -91,7 +91,7 @@ Extract the zip files, ignoring the top level directory, into `S:/Library`. The ``` /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/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/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/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/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/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.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/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/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/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/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/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/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/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/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'}} +}