Merge pull request #21014 from slavapestov/backward-deployment-5.0
Backward deployment fixes and tests [5.0]
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 095097e..e6ef61d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -176,6 +176,10 @@
the type checker so that it always compiles with optimization. This eases
debugging after type checking occurs by speeding up type checking" FALSE)
+option(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES
+ "Generate .swiftinterface files alongside .swiftmodule files"
+ FALSE)
+
#
# User-configurable Android specific options.
#
diff --git a/cmake/modules/AddSwift.cmake b/cmake/modules/AddSwift.cmake
index f9dadec..8eb79d4 100644
--- a/cmake/modules/AddSwift.cmake
+++ b/cmake/modules/AddSwift.cmake
@@ -376,7 +376,7 @@
function(_add_variant_link_flags)
set(oneValueArgs SDK ARCH BUILD_TYPE ENABLE_ASSERTIONS ANALYZE_CODE_COVERAGE
DEPLOYMENT_VERSION_OSX DEPLOYMENT_VERSION_IOS DEPLOYMENT_VERSION_TVOS DEPLOYMENT_VERSION_WATCHOS
- RESULT_VAR_NAME ENABLE_LTO LTO_OBJECT_NAME LIBRARY_SEARCH_DIRECTORIES_VAR_NAME)
+ RESULT_VAR_NAME ENABLE_LTO LTO_OBJECT_NAME LINK_LIBRARIES_VAR_NAME LIBRARY_SEARCH_DIRECTORIES_VAR_NAME)
cmake_parse_arguments(LFLAGS
""
"${oneValueArgs}"
@@ -387,6 +387,7 @@
precondition(LFLAGS_ARCH MESSAGE "Should specify an architecture")
set(result ${${LFLAGS_RESULT_VAR_NAME}})
+ set(link_libraries ${${LFLAGS_LINK_LIBRARIES_VAR_NAME}})
set(library_search_directories ${${LFLAGS_LIBRARY_SEARCH_DIRECTORIES_VAR_NAME}})
_add_variant_c_compile_link_flags(
@@ -403,9 +404,9 @@
RESULT_VAR_NAME result)
if("${LFLAGS_SDK}" STREQUAL "LINUX")
- list(APPEND result "-lpthread" "-latomic" "-ldl")
+ list(APPEND link_libraries "pthread" "atomic" "dl")
elseif("${LFLAGS_SDK}" STREQUAL "FREEBSD")
- list(APPEND result "-lpthread")
+ list(APPEND link_libraries "pthread")
elseif("${LFLAGS_SDK}" STREQUAL "CYGWIN")
# No extra libraries required.
elseif("${LFLAGS_SDK}" STREQUAL "WINDOWS")
@@ -423,9 +424,13 @@
list(APPEND library_search_directories
${CMAKE_BINARY_DIR}/winsdk_lib_${LFLAGS_ARCH}_symlinks)
elseif("${LFLAGS_SDK}" STREQUAL "HAIKU")
- list(APPEND result "-lbsd" "-latomic" "-Wl,-Bsymbolic")
+ list(APPEND link_libraries "bsd" "atomic")
+ list(APPEND result "-Wl,-Bsymbolic")
elseif("${LFLAGS_SDK}" STREQUAL "ANDROID")
- list(APPEND result "-ldl" "-llog" "-latomic" "-licudataswift" "-licui18nswift" "-licuucswift")
+ list(APPEND link_libraries "dl" "log" "atomic" "icudataswift" "icui18nswift" "icuucswift")
+ # We provide our own C++ below, so we ask the linker not to do it. However,
+ # we need to add the math library, which is linked implicitly by libc++.
+ list(APPEND result "-nostdlib++" "-lm")
if("${LFLAGS_ARCH}" MATCHES armv7)
list(APPEND result "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so")
elseif("${LFLAGS_ARCH}" MATCHES aarch64)
@@ -435,7 +440,7 @@
endif()
swift_android_lib_for_arch(${LFLAGS_ARCH} ${LFLAGS_ARCH}_LIB)
foreach(path IN LISTS ${LFLAGS_ARCH}_LIB)
- list(APPEND library_search_directories ${path})
+ list(APPEND library_search_directories ${path})
endforeach()
else()
# If lto is enabled, we need to add the object path flag so that the LTO code
@@ -475,6 +480,7 @@
endif()
set("${LFLAGS_RESULT_VAR_NAME}" "${result}" PARENT_SCOPE)
+ set("${LFLAGS_LINK_LIBRARIES_VAR_NAME}" "${link_libraries}" PARENT_SCOPE)
set("${LFLAGS_LIBRARY_SEARCH_DIRECTORIES_VAR_NAME}" "${library_search_directories}" PARENT_SCOPE)
endfunction()
@@ -1207,6 +1213,7 @@
DEPLOYMENT_VERSION_TVOS "${SWIFTLIB_DEPLOYMENT_VERSION_TVOS}"
DEPLOYMENT_VERSION_WATCHOS "${SWIFTLIB_DEPLOYMENT_VERSION_WATCHOS}"
RESULT_VAR_NAME link_flags
+ LINK_LIBRARIES_VAR_NAME link_libraries
LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories
)
@@ -1251,6 +1258,7 @@
COMPILE_FLAGS " ${c_compile_flags}")
set_property(TARGET "${target}" APPEND_STRING PROPERTY
LINK_FLAGS " ${link_flags}")
+ set_property(TARGET "${target}" APPEND PROPERTY LINK_LIBRARIES ${link_libraries})
swift_target_link_search_directories("${target}" "${library_search_directories}")
# Adjust the linked libraries for windows targets. On Windows, the link is
@@ -2119,6 +2127,7 @@
LTO_OBJECT_NAME "${name}-${SWIFTEXE_SINGLE_SDK}-${SWIFTEXE_SINGLE_ARCHITECTURE}"
ANALYZE_CODE_COVERAGE "${SWIFT_ANALYZE_CODE_COVERAGE}"
RESULT_VAR_NAME link_flags
+ LINK_LIBRARIES_VAR_NAME link_libraries
LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories)
if(${SWIFTEXE_SINGLE_SDK} IN_LIST SWIFT_APPLE_PLATFORMS)
@@ -2176,6 +2185,7 @@
swift_target_link_search_directories("${name}" "${library_search_directories}")
set_property(TARGET ${name} APPEND_STRING PROPERTY
LINK_FLAGS " ${link_flags}")
+ set_property(TARGET ${name} APPEND PROPERTY LINK_LIBRARIES ${link_libraries})
if (SWIFT_PARALLEL_LINK_JOBS)
set_property(TARGET ${name} PROPERTY JOB_POOL_LINK swift_link_job_pool)
endif()
diff --git a/cmake/modules/SwiftSharedCMakeConfig.cmake b/cmake/modules/SwiftSharedCMakeConfig.cmake
index 646846c..abf7917 100644
--- a/cmake/modules/SwiftSharedCMakeConfig.cmake
+++ b/cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -226,7 +226,7 @@
set(PATH_TO_LLVM_BUILD "${CMAKE_BINARY_DIR}")
set(${product}_PATH_TO_CLANG_BUILD "${CMAKE_BINARY_DIR}")
set(PATH_TO_CLANG_BUILD "${CMAKE_BINARY_DIR}")
- set(CLANG_MAIN_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/tools/clang/include")
+ set(CLANG_MAIN_INCLUDE_DIR "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/include")
set(CLANG_BUILD_INCLUDE_DIR "${CMAKE_BINARY_DIR}/tools/clang/include")
set(${product}_NATIVE_LLVM_TOOLS_PATH "${CMAKE_BINARY_DIR}/bin")
set(${product}_NATIVE_CLANG_TOOLS_PATH "${CMAKE_BINARY_DIR}/bin")
@@ -235,8 +235,8 @@
# If cmark was checked out into tools/cmark, expect to build it as
# part of the unified build.
- if(EXISTS "${CMAKE_SOURCE_DIR}/tools/cmark/")
- set(${product}_PATH_TO_CMARK_SOURCE "${CMAKE_SOURCE_DIR}/tools/cmark")
+ if(EXISTS "${LLVM_EXTERNAL_CMARK_SOURCE_DIR}")
+ set(${product}_PATH_TO_CMARK_SOURCE "${LLVM_EXTERNAL_CMARK_SOURCE_DIR}")
set(${product}_PATH_TO_CMARK_BUILD "${CMAKE_BINARY_DIR}/tools/cmark")
set(${product}_CMARK_LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib")
diff --git a/cmake/modules/SwiftSource.cmake b/cmake/modules/SwiftSource.cmake
index 92dfd62..6a710a7 100644
--- a/cmake/modules/SwiftSource.cmake
+++ b/cmake/modules/SwiftSource.cmake
@@ -303,6 +303,7 @@
set(module_file)
set(module_doc_file)
+ set(interface_file)
if(NOT SWIFTFILE_IS_MAIN)
# Determine the directory where the module file should be placed.
@@ -322,7 +323,11 @@
set(sibopt_file "${module_base}.O.sib")
set(sibgen_file "${module_base}.sibgen")
set(module_doc_file "${module_base}.swiftdoc")
- set(interface_file "${module_base}.swiftinterface")
+
+ if(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES)
+ set(interface_file "${module_base}.swiftinterface")
+ list(APPEND swift_flags "-emit-parseable-module-interface")
+ endif()
list(APPEND command_create_dirs
COMMAND "${CMAKE_COMMAND}" -E make_directory "${module_dir}")
@@ -338,8 +343,13 @@
endif()
endif()
+ set(module_outputs "${module_file}" "${module_doc_file}")
+ if(interface_file)
+ list(APPEND module_outputs "${interface_file}")
+ endif()
+
swift_install_in_component("${SWIFTFILE_INSTALL_IN_COMPONENT}"
- FILES "${module_file}" "${module_doc_file}" "${interface_file}"
+ FILES ${module_outputs}
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}")
set(line_directive_tool "${SWIFT_SOURCE_DIR}/utils/line-directive")
@@ -396,7 +406,6 @@
set(standard_outputs ${SWIFTFILE_OUTPUT})
set(apinotes_outputs ${apinote_files})
- set(module_outputs "${module_file}" "${module_doc_file}" "${interface_file}")
set(sib_outputs "${sib_file}")
set(sibopt_outputs "${sibopt_file}")
set(sibgen_outputs "${sibgen_file}")
@@ -499,15 +508,11 @@
add_custom_command_target(
module_dependency_target
COMMAND
- "${CMAKE_COMMAND}" "-E" "remove" "-f" "${module_file}"
- COMMAND
- "${CMAKE_COMMAND}" "-E" "remove" "-f" "${module_doc_file}"
- COMMAND
- "${CMAKE_COMMAND}" "-E" "remove" "-f" "${interface_file}"
+ "${CMAKE_COMMAND}" "-E" "remove" "-f" ${module_outputs}
COMMAND
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"
- "-emit-parseable-module-interface" ${swift_flags} "@${file_path}"
+ ${swift_flags} "@${file_path}"
${command_touch_module_outputs}
OUTPUT ${module_outputs}
DEPENDS
diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h
index 5318395..9dfe04e 100644
--- a/include/swift/AST/Decl.h
+++ b/include/swift/AST/Decl.h
@@ -3975,6 +3975,9 @@
->existentialConformsToSelfSlow();
}
+ /// Does this protocol require a self-conformance witness table?
+ bool requiresSelfConformanceWitnessTable() const;
+
/// Find direct Self references within the given requirement.
///
/// \param allowCovariantParameters If true, 'Self' is assumed to be
diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def
index 639cee3..7d84ae3 100644
--- a/include/swift/AST/DiagnosticsSema.def
+++ b/include/swift/AST/DiagnosticsSema.def
@@ -2942,8 +2942,11 @@
"escaping closures can only capture inout parameters explicitly by value",
())
ERROR(closure_implicit_capture_mutating_self,none,
- "closure cannot implicitly capture a mutating self parameter",
+ "escaping closure cannot capture a mutating self parameter",
())
+NOTE(create_mutating_copy_or_capture_self,none,
+ "create a mutating copy of self, or explicitly capture self for immutability",
+ ())
ERROR(nested_function_with_implicit_capture_argument,none,
"nested function with %select{an |}0implicitly captured inout "
"parameter%select{|s}0 can only be used as a non-escaping argument", (bool))
diff --git a/include/swift/AST/GenericSignature.h b/include/swift/AST/GenericSignature.h
index db19336..d51a9c7 100644
--- a/include/swift/AST/GenericSignature.h
+++ b/include/swift/AST/GenericSignature.h
@@ -313,6 +313,7 @@
ArrayRef<Requirement> requirements);
void print(raw_ostream &OS, PrintOptions Options = PrintOptions()) const;
+ void print(ASTPrinter &Printer, PrintOptions Opts = PrintOptions()) const;
void dump() const;
std::string getAsString() const;
};
diff --git a/include/swift/AST/Module.h b/include/swift/AST/Module.h
index 5e4b6b0..1bfef4b 100644
--- a/include/swift/AST/Module.h
+++ b/include/swift/AST/Module.h
@@ -385,6 +385,11 @@
Optional<ProtocolConformanceRef>
lookupConformance(Type type, ProtocolDecl *protocol);
+ /// Look for the conformance of the given existential type to the given
+ /// protocol.
+ Optional<ProtocolConformanceRef>
+ lookupExistentialConformance(Type type, ProtocolDecl *protocol);
+
/// Find a member named \p name in \p container that was declared in this
/// module.
///
diff --git a/include/swift/Basic/Lazy.h b/include/swift/Basic/Lazy.h
index 2cf2704..594e2ed 100644
--- a/include/swift/Basic/Lazy.h
+++ b/include/swift/Basic/Lazy.h
@@ -58,6 +58,9 @@
T &get(void (*initCallback)(void *) = defaultInitCallback);
+ template<typename Arg1>
+ T &getWithInit(Arg1 &&arg1);
+
/// Get the value, assuming it must have already been initialized by this
/// point.
T &unsafeGetAlreadyInitialized() { return *reinterpret_cast<T *>(&Value); }
@@ -80,6 +83,22 @@
return unsafeGetAlreadyInitialized();
}
+template <typename T>
+template <typename Arg1> inline T &Lazy<T>::getWithInit(Arg1 &&arg1) {
+ struct Data {
+ void *address;
+ Arg1 &&arg1;
+
+ static void init(void *context) {
+ Data *data = static_cast<Data *>(context);
+ ::new (data->address) T(static_cast<Arg1&&>(data->arg1));
+ }
+ } data{&Value, static_cast<Arg1&&>(arg1)};
+
+ SWIFT_ONCE_F(OnceToken, &Data::init, &data);
+ return unsafeGetAlreadyInitialized();
+}
+
} // end namespace swift
#define SWIFT_LAZY_CONSTANT(INITIAL_VALUE) \
diff --git a/include/swift/Option/Options.td b/include/swift/Option/Options.td
index c38cd0f..e7dfc9f 100644
--- a/include/swift/Option/Options.td
+++ b/include/swift/Option/Options.td
@@ -748,6 +748,9 @@
MetaVarName<"<arg>">,
HelpText<"Pass <arg> to the C/C++/Objective-C compiler">;
+def Xclang_linker : Separate<["-"], "Xclang-linker">, Flags<[HelpHidden]>,
+ MetaVarName<"<arg>">, HelpText<"Pass <arg> to Clang when it is use for linking.">;
+
def Xllvm : Separate<["-"], "Xllvm">,
Flags<[FrontendOption, HelpHidden]>,
MetaVarName<"<arg>">, HelpText<"Pass <arg> to LLVM.">;
diff --git a/include/swift/Parse/Parser.h b/include/swift/Parse/Parser.h
index 6463192..414ee24 100644
--- a/include/swift/Parse/Parser.h
+++ b/include/swift/Parse/Parser.h
@@ -972,9 +972,9 @@
/// \brief Parse layout constraint.
LayoutConstraint parseLayoutConstraint(Identifier LayoutConstraintID);
- bool parseGenericArguments(SmallVectorImpl<TypeRepr*> &Args,
- SourceLoc &LAngleLoc,
- SourceLoc &RAngleLoc);
+ ParserStatus parseGenericArguments(SmallVectorImpl<TypeRepr *> &Args,
+ SourceLoc &LAngleLoc,
+ SourceLoc &RAngleLoc);
ParserResult<TypeRepr> parseTypeIdentifier();
ParserResult<TypeRepr> parseOldStyleProtocolComposition();
diff --git a/include/swift/Runtime/Metadata.h b/include/swift/Runtime/Metadata.h
index 10c4911..0aec2af 100644
--- a/include/swift/Runtime/Metadata.h
+++ b/include/swift/Runtime/Metadata.h
@@ -495,6 +495,11 @@
const ClassMetadata *
swift_getObjCClassFromMetadata(const Metadata *theClass);
+// Get the ObjC class object from class type metadata,
+// or nullptr if the type isn't an ObjC class.
+const ClassMetadata *
+swift_getObjCClassFromMetadataConditional(const Metadata *theClass);
+
SWIFT_RUNTIME_EXPORT
const ClassMetadata *
swift_getObjCClassFromObject(HeapObject *object);
diff --git a/include/swift/Sema/IDETypeChecking.h b/include/swift/Sema/IDETypeChecking.h
index 1f2c057..c55dbce 100644
--- a/include/swift/Sema/IDETypeChecking.h
+++ b/include/swift/Sema/IDETypeChecking.h
@@ -98,19 +98,16 @@
Expr *&parsedExpr,
ConcreteDeclRef &referencedDecl);
- /// Typecheck the sequence expression \p parsedExpr for code completion.
+ /// Resolve type of operator function with \c opName appending it to \c LHS.
///
- /// This requires that \p parsedExpr is a SequenceExpr and that it contains:
- /// * ... leading sequence LHS
- /// * UnresolvedDeclRefExpr operator
- /// * CodeCompletionExpr RHS
- ///
- /// On success, returns false, and replaces parsedExpr with the binary
- /// expression corresponding to the operator. The type of the operator and
- /// RHS are also set, but the rest of the expression may not be typed
- ///
- /// The LHS should already be type-checked or this will be very slow.
- bool typeCheckCompletionSequence(DeclContext *DC, Expr *&parsedExpr);
+ /// For \p refKind, use \c DeclRefKind::PostfixOperator for postfix operator,
+ /// or \c DeclRefKind::BinaryOperator for infix operator.
+ /// On success, returns resolved function type of the operator. The LHS should
+ /// already be type-checked. This function guarantees LHS not to be modified.
+ FunctionType *getTypeOfCompletionOperator(DeclContext *DC, Expr *LHS,
+ Identifier opName,
+ DeclRefKind refKind,
+ ConcreteDeclRef &referencedDecl);
/// Typecheck the given expression.
bool typeCheckExpression(DeclContext *DC, Expr *&parsedExpr);
diff --git a/lib/AST/ASTPrinter.cpp b/lib/AST/ASTPrinter.cpp
index ec97c83..8502fbd 100644
--- a/lib/AST/ASTPrinter.cpp
+++ b/lib/AST/ASTPrinter.cpp
@@ -1391,13 +1391,10 @@
}
} else {
Printer.callPrintStructurePre(PrintStructureKind::GenericRequirement);
- if (second) {
- Requirement substReq(req.getKind(), first, second);
- printRequirement(substReq);
- } else {
- Requirement substReq(req.getKind(), first, req.getLayoutConstraint());
- printRequirement(substReq);
- }
+
+ // We don't substitute type for the printed requirement so that the
+ // printed requirement agrees with separately reported generic parameters.
+ printRequirement(req);
Printer.printStructurePost(PrintStructureKind::GenericRequirement);
}
}
@@ -4135,11 +4132,15 @@
void GenericSignature::print(raw_ostream &OS, PrintOptions Opts) const {
StreamPrinter Printer(OS);
- PrintAST(Printer, Opts)
- .printGenericSignature(this,
- PrintAST::PrintParams |
- PrintAST::PrintRequirements);
+ print(Printer, Opts);
}
+
+void GenericSignature::print(ASTPrinter &Printer, PrintOptions Opts) const {
+ PrintAST(Printer, Opts).printGenericSignature(this,
+ PrintAST::PrintParams |
+ PrintAST::PrintRequirements);
+}
+
void GenericSignature::dump() const {
print(llvm::errs());
llvm::errs() << '\n';
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 59bc7e7..37ff731 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -3869,15 +3869,22 @@
return Bits.ProtocolDecl.RequiresClass;
}
+bool ProtocolDecl::requiresSelfConformanceWitnessTable() const {
+ return isSpecificProtocol(KnownProtocolKind::Error);
+}
+
bool ProtocolDecl::existentialConformsToSelfSlow() {
// Assume for now that the existential conforms to itself; this
// prevents circularity issues.
Bits.ProtocolDecl.ExistentialConformsToSelfValid = true;
Bits.ProtocolDecl.ExistentialConformsToSelf = true;
+ // If it's not @objc, it conforms to itself only if it has a
+ // self-conformance witness table.
if (!isObjC()) {
- Bits.ProtocolDecl.ExistentialConformsToSelf = false;
- return false;
+ bool hasSelfConformance = requiresSelfConformanceWitnessTable();
+ Bits.ProtocolDecl.ExistentialConformsToSelf = hasSelfConformance;
+ return hasSelfConformance;
}
// Check whether this protocol conforms to itself.
diff --git a/lib/AST/LookupVisibleDecls.cpp b/lib/AST/LookupVisibleDecls.cpp
index 0dc9709..8acde2c 100644
--- a/lib/AST/LookupVisibleDecls.cpp
+++ b/lib/AST/LookupVisibleDecls.cpp
@@ -942,11 +942,10 @@
Consumer.foundDecl(DeclAndReason.D, DeclAndReason.Reason);
}
-void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
- const DeclContext *DC,
- LazyResolver *TypeResolver,
- bool IncludeTopLevel,
- SourceLoc Loc) {
+static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
+ const DeclContext *DC,
+ LazyResolver *TypeResolver,
+ bool IncludeTopLevel, SourceLoc Loc) {
const ModuleDecl &M = *DC->getParentModule();
const SourceManager &SM = DC->getASTContext().SourceMgr;
auto Reason = DeclVisibilityKind::MemberOfCurrentNominal;
@@ -1067,6 +1066,65 @@
}
}
+void swift::lookupVisibleDecls(VisibleDeclConsumer &Consumer,
+ const DeclContext *DC,
+ LazyResolver *TypeResolver,
+ bool IncludeTopLevel,
+ SourceLoc Loc) {
+ if (Loc.isInvalid()) {
+ lookupVisibleDeclsImpl(Consumer, DC, TypeResolver, IncludeTopLevel, Loc);
+ return;
+ }
+
+ // Filtering out unusable values.
+ class LocalConsumer : public VisibleDeclConsumer {
+ const SourceManager &SM;
+ SourceLoc Loc;
+ VisibleDeclConsumer &Consumer;
+
+ bool isUsableValue(ValueDecl *VD, DeclVisibilityKind Reason) {
+
+ // Check "use within its own initial value" case.
+ if (auto *varD = dyn_cast<VarDecl>(VD))
+ if (auto *PBD = varD->getParentPatternBinding())
+ if (!PBD->isImplicit() &&
+ SM.rangeContainsTokenLoc(PBD->getSourceRange(), Loc))
+ return false;
+
+ switch (Reason) {
+ case DeclVisibilityKind::LocalVariable:
+ // Use of 'TypeDecl's before declaration is allowed.
+ if (isa<TypeDecl>(VD))
+ return true;
+
+ return SM.isBeforeInBuffer(VD->getLoc(), Loc);
+
+ case DeclVisibilityKind::VisibleAtTopLevel:
+ // TODO: Implement forward reference rule for script mode? Currently,
+ // it's not needed because the rest of the file hasn't been parsed.
+ // See: https://bugs.swift.org/browse/SR-284 for the rule.
+ return true;
+
+ default:
+ // Other visibility kind are always usable.
+ return true;
+ }
+ }
+
+ public:
+ LocalConsumer(const SourceManager &SM, SourceLoc Loc,
+ VisibleDeclConsumer &Consumer)
+ : SM(SM), Loc(Loc), Consumer(Consumer) {}
+
+ void foundDecl(ValueDecl *VD, DeclVisibilityKind Reason) {
+ if (isUsableValue(VD, Reason))
+ Consumer.foundDecl(VD, Reason);
+ }
+ } LocalConsumer(DC->getASTContext().SourceMgr, Loc, Consumer);
+
+ lookupVisibleDeclsImpl(LocalConsumer, DC, TypeResolver, IncludeTopLevel, Loc);
+}
+
void swift::lookupVisibleMemberDecls(VisibleDeclConsumer &Consumer, Type BaseTy,
const DeclContext *CurrDC,
LazyResolver *TypeResolver,
diff --git a/lib/AST/Module.cpp b/lib/AST/Module.cpp
index e842ef7..dda4ece 100644
--- a/lib/AST/Module.cpp
+++ b/lib/AST/Module.cpp
@@ -571,6 +571,66 @@
}
Optional<ProtocolConformanceRef>
+ModuleDecl::lookupExistentialConformance(Type type, ProtocolDecl *protocol) {
+ assert(type->isExistentialType());
+
+ // If the existential type cannot be represented or the protocol does not
+ // conform to itself, there's no point in looking further.
+ if (!protocol->existentialConformsToSelf())
+ return None;
+
+ auto layout = type->getExistentialLayout();
+
+ // Due to an IRGen limitation, witness tables cannot be passed from an
+ // existential to an archetype parameter, so for now we restrict this to
+ // @objc protocols.
+ if (!layout.isObjC()) {
+ // There's a specific exception for protocols with self-conforming
+ // witness tables, but the existential has to be *exactly* that type.
+ // TODO: synthesize witness tables on-demand for protocol compositions
+ // that can satisfy the requirement.
+ if (protocol->requiresSelfConformanceWitnessTable() &&
+ type->is<ProtocolType>() &&
+ type->castTo<ProtocolType>()->getDecl() == protocol)
+ return ProtocolConformanceRef(protocol);
+
+ return None;
+ }
+
+ // If the existential is class-constrained, the class might conform
+ // concretely.
+ if (auto superclass = layout.explicitSuperclass) {
+ if (auto result = lookupConformance(superclass, protocol))
+ return result;
+ }
+
+ // Otherwise, the existential might conform abstractly.
+ for (auto proto : layout.getProtocols()) {
+ auto *protoDecl = proto->getDecl();
+
+ // If we found the protocol we're looking for, return an abstract
+ // conformance to it.
+ if (protoDecl == protocol)
+ return ProtocolConformanceRef(protocol);
+
+ // If the protocol has a superclass constraint, we might conform
+ // concretely.
+ if (auto superclass = protoDecl->getSuperclass()) {
+ if (auto result = lookupConformance(superclass, protocol))
+ return result;
+ }
+
+ // Now check refined protocols.
+ if (protoDecl->inheritsFrom(protocol))
+ return ProtocolConformanceRef(protocol);
+ }
+
+ // We didn't find our protocol in the existential's list; it doesn't
+ // conform.
+ return None;
+}
+
+Optional<ProtocolConformanceRef>
ModuleDecl::lookupConformance(Type type, ProtocolDecl *protocol) {
ASTContext &ctx = getASTContext();
@@ -609,52 +669,8 @@
// An existential conforms to a protocol if the protocol is listed in the
// existential's list of conformances and the existential conforms to
// itself.
- if (type->isExistentialType()) {
- // If the existential type cannot be represented or the protocol does not
- // conform to itself, there's no point in looking further.
- if (!protocol->existentialConformsToSelf())
- return None;
-
- auto layout = type->getExistentialLayout();
-
- // Due to an IRGen limitation, witness tables cannot be passed from an
- // existential to an archetype parameter, so for now we restrict this to
- // @objc protocols.
- if (!layout.isObjC())
- return None;
-
- // If the existential is class-constrained, the class might conform
- // concretely.
- if (auto superclass = layout.explicitSuperclass) {
- if (auto result = lookupConformance(superclass, protocol))
- return result;
- }
-
- // Otherwise, the existential might conform abstractly.
- for (auto proto : layout.getProtocols()) {
- auto *protoDecl = proto->getDecl();
-
- // If we found the protocol we're looking for, return an abstract
- // conformance to it.
- if (protoDecl == protocol)
- return ProtocolConformanceRef(protocol);
-
- // If the protocol has a superclass constraint, we might conform
- // concretely.
- if (auto superclass = protoDecl->getSuperclass()) {
- if (auto result = lookupConformance(superclass, protocol))
- return result;
- }
-
- // Now check refined protocols.
- if (protoDecl->inheritsFrom(protocol))
- return ProtocolConformanceRef(protocol);
- }
-
- // We didn't find our protocol in the existential's list; it doesn't
- // conform.
- return None;
- }
+ if (type->isExistentialType())
+ return lookupExistentialConformance(type, protocol);
// Type variables have trivial conformances.
if (type->isTypeVariableOrMember())
@@ -669,7 +685,7 @@
auto nominal = type->getAnyNominal();
// If we don't have a nominal type, there are no conformances.
- if (!nominal) return None;
+ if (!nominal || isa<ProtocolDecl>(nominal)) return None;
// Find the (unspecialized) conformance.
SmallVector<ProtocolConformance *, 2> conformances;
diff --git a/lib/AST/ProtocolConformance.cpp b/lib/AST/ProtocolConformance.cpp
index 3e69e18..71c9090 100644
--- a/lib/AST/ProtocolConformance.cpp
+++ b/lib/AST/ProtocolConformance.cpp
@@ -112,14 +112,16 @@
if (substType->isOpenedExistential())
return *this;
- // If the substituted type is an existential, we have a self-conforming
- // existential being substituted in place of itself. There's no
- // conformance information in this case, so just return.
- if (substType->isObjCExistentialType())
- return *this;
-
auto *proto = getRequirement();
+ // If the type is an existential, it must be self-conforming.
+ if (substType->isExistentialType()) {
+ auto optConformance =
+ proto->getModuleContext()->lookupExistentialConformance(substType, proto);
+ assert(optConformance && "existential type didn't self-conform");
+ return *optConformance;
+ }
+
// Check the conformance map.
if (auto result = conformances(origType->getCanonicalType(),
substType, proto)) {
@@ -1430,9 +1432,12 @@
if (!nominal)
return result;
- // Protocols don't have conformances.
- if (isa<ProtocolDecl>(nominal))
+ // Protocols only have self-conformances.
+ if (auto protocol = dyn_cast<ProtocolDecl>(nominal)) {
+ if (protocol->requiresSelfConformanceWitnessTable())
+ return { protocol->getASTContext().getSelfConformance(protocol) };
return { };
+ }
// Update to record all potential conformances.
nominal->prepareConformanceTable();
diff --git a/lib/Demangling/OldRemangler.cpp b/lib/Demangling/OldRemangler.cpp
index 45c17b9..7a1b115 100644
--- a/lib/Demangling/OldRemangler.cpp
+++ b/lib/Demangling/OldRemangler.cpp
@@ -1894,6 +1894,11 @@
break;
}
+ case Node::Kind::Extension: {
+ mangleGenericArgs(node->getChild(1), ctx);
+ break;
+ }
+
default:
break;
}
diff --git a/lib/Driver/UnixToolChains.cpp b/lib/Driver/UnixToolChains.cpp
index 77aa043..06ae09c 100644
--- a/lib/Driver/UnixToolChains.cpp
+++ b/lib/Driver/UnixToolChains.cpp
@@ -103,6 +103,7 @@
std::string toolchains::GenericUnix::getDefaultLinker() const {
switch (getTriple().getArch()) {
case llvm::Triple::arm:
+ case llvm::Triple::aarch64:
case llvm::Triple::armeb:
case llvm::Triple::thumb:
case llvm::Triple::thumbeb:
@@ -332,6 +333,7 @@
// These custom arguments should be right before the object file at the end.
context.Args.AddAllArgs(Arguments, options::OPT_linker_option_Group);
context.Args.AddAllArgs(Arguments, options::OPT_Xlinker);
+ context.Args.AddAllArgValues(Arguments, options::OPT_Xclang_linker);
// This should be the last option, for convenience in checking output.
Arguments.push_back("-o");
diff --git a/lib/Driver/WindowsToolChains.cpp b/lib/Driver/WindowsToolChains.cpp
index 7dfa371..9f7f826 100644
--- a/lib/Driver/WindowsToolChains.cpp
+++ b/lib/Driver/WindowsToolChains.cpp
@@ -168,6 +168,7 @@
context.Args.AddAllArgs(Arguments, options::OPT_Xlinker);
context.Args.AddAllArgs(Arguments, options::OPT_linker_option_Group);
+ context.Args.AddAllArgValues(Arguments, options::OPT_Xclang_linker);
// Run clang++ in verbose mode if "-v" is set
if (context.Args.hasArg(options::OPT_v)) {
diff --git a/lib/IDE/CodeCompletion.cpp b/lib/IDE/CodeCompletion.cpp
index 6be2f80..415e6c3 100644
--- a/lib/IDE/CodeCompletion.cpp
+++ b/lib/IDE/CodeCompletion.cpp
@@ -3291,35 +3291,15 @@
}
void tryPostfixOperator(Expr *expr, PostfixOperatorDecl *op) {
- auto Ty = expr->getType();
- if (!Ty)
+ ConcreteDeclRef referencedDecl;
+ FunctionType *funcTy = getTypeOfCompletionOperator(
+ const_cast<DeclContext *>(CurrDeclContext), expr, op->getName(),
+ DeclRefKind::PostfixOperator, referencedDecl);
+ if (!funcTy)
return;
- SWIFT_DEFER {
- // Restore type.
- // FIXME: This is workaround for getTypeOfExpressionWithoutApplying()
- // modifies type of 'expr'.
- expr->setType(Ty);
- prepareForRetypechecking(expr);
- };
-
- // We allocate these expressions on the stack because we know they can't
- // escape and there isn't a better way to allocate scratch Expr nodes.
- UnresolvedDeclRefExpr UDRE(op->getName(), DeclRefKind::PostfixOperator,
- DeclNameLoc(expr->getSourceRange().End));
- ParenExpr parenExpr(expr->getSourceRange().Start, expr,
- expr->getSourceRange().End,
- /*hasTrailingClosure=*/false);
- PostfixUnaryExpr opExpr(&UDRE, &parenExpr);
- Expr *tempExpr = &opExpr;
- ConcreteDeclRef referencedDecl;
- if (auto T = getTypeOfCompletionContextExpr(
- CurrDeclContext->getASTContext(),
- const_cast<DeclContext *>(CurrDeclContext),
- CompletionTypeCheckKind::Normal,
- tempExpr,
- referencedDecl))
- addPostfixOperatorCompletion(op, *T);
+ // TODO: Use referencedDecl (FuncDecl) instead of 'op' (OperatorDecl).
+ addPostfixOperatorCompletion(op, funcTy->getResult());
}
void addAssignmentOperator(Type RHSType, Type resultType) {
@@ -3366,169 +3346,67 @@
addTypeAnnotation(builder, resultType);
}
- void tryInfixOperatorCompletion(InfixOperatorDecl *op, SequenceExpr *SE) {
- if (op->getName().str() == "~>")
+ void tryInfixOperatorCompletion(Expr *foldedExpr, InfixOperatorDecl *op) {
+ ConcreteDeclRef referencedDecl;
+ FunctionType *funcTy = getTypeOfCompletionOperator(
+ const_cast<DeclContext *>(CurrDeclContext), foldedExpr, op->getName(),
+ DeclRefKind::BinaryOperator, referencedDecl);
+ if (!funcTy)
return;
- MutableArrayRef<Expr *> sequence = SE->getElements();
- assert(sequence.size() >= 3 && !sequence.back() &&
- !sequence.drop_back(1).back() && "sequence not cleaned up");
- assert((sequence.size() & 1) && "sequence expr ending with operator");
+ Type lhsTy = funcTy->getParams()[0].getPlainType();
+ Type rhsTy = funcTy->getParams()[1].getPlainType();
+ Type resultTy = funcTy->getResult();
- // FIXME: these checks should apply to the LHS of the operator, not the
- // immediately left expression. Move under the type-checking.
- Expr *LHS = sequence.drop_back(2).back();
- if (LHS->getType() && (LHS->getType()->is<MetatypeType>() ||
- LHS->getType()->is<AnyFunctionType>()))
- return;
-
- // Preserve LHS type for restoring it.
- Type LHSTy = LHS->getType();
-
- // We allocate these expressions on the stack because we know they can't
- // escape and there isn't a better way to allocate scratch Expr nodes.
- UnresolvedDeclRefExpr UDRE(op->getName(), DeclRefKind::BinaryOperator,
- DeclNameLoc(LHS->getEndLoc()));
- sequence.drop_back(1).back() = &UDRE;
- CodeCompletionExpr CCE(LHS->getSourceRange());
- sequence.back() = &CCE;
-
- SWIFT_DEFER {
- // Reset sequence.
- SE->setElement(SE->getNumElements() - 1, nullptr);
- SE->setElement(SE->getNumElements() - 2, nullptr);
- LHS->setType(LHSTy);
- prepareForRetypechecking(SE);
-
- for (auto &element : sequence.drop_back(2)) {
- // Unfold expressions for re-typechecking sequence.
- if (auto *assignExpr = dyn_cast_or_null<AssignExpr>(element)) {
- assignExpr->setSrc(nullptr);
- assignExpr->setDest(nullptr);
- } else if (auto *ifExpr = dyn_cast_or_null<IfExpr>(element)) {
- ifExpr->setCondExpr(nullptr);
- ifExpr->setElseExpr(nullptr);
- }
-
- // Reset any references to operators in types, so they are properly
- // handled as operators by sequence folding.
- //
- // FIXME: Would be better to have some kind of 'OperatorRefExpr'?
- if (auto operatorRef = element->getMemberOperatorRef()) {
- operatorRef->setType(nullptr);
- element = operatorRef;
- }
- }
- };
-
- Expr *expr = SE;
- if (!typeCheckCompletionSequence(const_cast<DeclContext *>(CurrDeclContext),
- expr)) {
- if (!LHS->getType() ||
- !LHS->getType()->getRValueType()->getOptionalObjectType()) {
- // Don't complete optional operators on non-optional types.
- // FIXME: can we get the type-checker to disallow these for us?
- if (op->getName().str() == "??")
- return;
- if (auto NT = CCE.getType()->getNominalOrBoundGenericNominal()) {
- if (NT->getName() ==
- CurrDeclContext->getASTContext().Id_OptionalNilComparisonType)
- return;
- }
- }
-
- // If the right-hand side and result type are both type parameters, we're
- // not providing a useful completion.
- if (expr->getType()->isTypeParameter() &&
- CCE.getType()->isTypeParameter())
+ // Don't complete optional operators on non-optional types.
+ if (!lhsTy->getRValueType()->getOptionalObjectType()) {
+ // 'T ?? T'
+ if (op->getName().str() == "??")
return;
-
- addInfixOperatorCompletion(op, expr->getType(), CCE.getType());
+ // 'T == nil'
+ if (auto NT = rhsTy->getNominalOrBoundGenericNominal())
+ if (NT->getName() ==
+ CurrDeclContext->getASTContext().Id_OptionalNilComparisonType)
+ return;
}
+
+ // If the right-hand side and result type are both type parameters, we're
+ // not providing a useful completion.
+ if (resultTy->isTypeParameter() && rhsTy->isTypeParameter())
+ return;
+
+ // TODO: Use referencedDecl (FuncDecl) instead of 'op' (OperatorDecl).
+ addInfixOperatorCompletion(op, funcTy->getResult(),
+ funcTy->getParams()[1].getPlainType());
}
- void flattenBinaryExpr(Expr *expr, SmallVectorImpl<Expr *> &sequence) {
- if (auto binExpr = dyn_cast<BinaryExpr>(expr)) {
- flattenBinaryExpr(binExpr->getArg()->getElement(0), sequence);
- sequence.push_back(binExpr->getFn());
- flattenBinaryExpr(binExpr->getArg()->getElement(1), sequence);
- } else if (auto assignExpr = dyn_cast<AssignExpr>(expr)) {
- flattenBinaryExpr(assignExpr->getDest(), sequence);
- sequence.push_back(assignExpr);
- flattenBinaryExpr(assignExpr->getSrc(), sequence);
- assignExpr->setDest(nullptr);
- assignExpr->setSrc(nullptr);
- } else if (auto ifExpr = dyn_cast<IfExpr>(expr)) {
- flattenBinaryExpr(ifExpr->getCondExpr(), sequence);
- sequence.push_back(ifExpr);
- flattenBinaryExpr(ifExpr->getElseExpr(), sequence);
- ifExpr->setCondExpr(nullptr);
- ifExpr->setElseExpr(nullptr);
- } else if (auto tryExpr = dyn_cast<AnyTryExpr>(expr)) {
- // Strip out try expression. It doesn't affect completion.
- flattenBinaryExpr(tryExpr->getSubExpr(), sequence);
- } else if (auto optEval = dyn_cast<OptionalEvaluationExpr>(expr)){
- // Strip out optional evaluation expression. It doesn't affect completion.
- flattenBinaryExpr(optEval->getSubExpr(), sequence);
- } else {
- sequence.push_back(expr);
- }
- }
+ Expr *typeCheckLeadingSequence(Expr *LHS, ArrayRef<Expr *> leadingSequence) {
+ if (leadingSequence.empty())
+ return LHS;
- void typeCheckLeadingSequence(SmallVectorImpl<Expr *> &sequence) {
-
- // Strip out try and optional evaluation expr because foldSequence() mutates
- // hierarchy of these expressions. They don't affect completion anyway.
- for (auto &element : sequence) {
- if (auto *tryExpr = dyn_cast<AnyTryExpr>(element))
- element = tryExpr->getSubExpr();
- if (auto *optEval = dyn_cast<OptionalEvaluationExpr>(element))
- element = optEval->getSubExpr();
- }
+ assert(leadingSequence.size() % 2 == 0);
+ SmallVector<Expr *, 3> sequence(leadingSequence.begin(),
+ leadingSequence.end());
+ sequence.push_back(LHS);
Expr *expr =
SequenceExpr::create(CurrDeclContext->getASTContext(), sequence);
prepareForRetypechecking(expr);
- // Take advantage of the fact the type-checker leaves the types on the AST.
if (!typeCheckExpression(const_cast<DeclContext *>(CurrDeclContext),
expr)) {
- // Rebuild the sequence from the type-checked version.
- sequence.clear();
- flattenBinaryExpr(expr, sequence);
- return;
+ return expr;
}
-
- // Fall back to just using the immediate LHS.
- auto LHS = sequence.back();
- sequence.clear();
- sequence.push_back(LHS);
+ return LHS;
}
void getOperatorCompletions(Expr *LHS, ArrayRef<Expr *> leadingSequence) {
- std::vector<OperatorDecl *> operators = collectOperators();
+ Expr *foldedExpr = typeCheckLeadingSequence(LHS, leadingSequence);
+ std::vector<OperatorDecl *> operators = collectOperators();
// FIXME: this always chooses the first operator with the given name.
llvm::DenseSet<Identifier> seenPostfixOperators;
llvm::DenseSet<Identifier> seenInfixOperators;
- SmallVector<Expr *, 3> sequence(leadingSequence.begin(),
- leadingSequence.end());
- sequence.push_back(LHS);
- assert((sequence.size() & 1) && "sequence expr ending with operator");
-
- if (sequence.size() > 1)
- typeCheckLeadingSequence(sequence);
-
- // Retrieve typechecked LHS.
- LHS = sequence.back();
-
- // Create a single sequence expression, which we will modify for each
- // operator, filling in the operator and dummy right-hand side.
- sequence.push_back(nullptr); // operator
- sequence.push_back(nullptr); // RHS
- auto *SE = SequenceExpr::create(CurrDeclContext->getASTContext(), sequence);
- prepareForRetypechecking(SE);
-
for (auto op : operators) {
switch (op->getKind()) {
case DeclKind::PrefixOperator:
@@ -3541,7 +3419,7 @@
break;
case DeclKind::InfixOperator:
if (seenInfixOperators.insert(op->getName()).second)
- tryInfixOperatorCompletion(cast<InfixOperatorDecl>(op), SE);
+ tryInfixOperatorCompletion(foldedExpr, cast<InfixOperatorDecl>(op));
break;
default:
llvm_unreachable("unexpected operator kind");
@@ -3887,226 +3765,6 @@
}
}
- using FunctionParams = ArrayRef<AnyFunctionType::Param>;
-
- static void collectPossibleParamListByQualifiedLookup(
- DeclContext &DC, Type baseTy, DeclBaseName name,
- SmallVectorImpl<FunctionParams> &candidates) {
-
- SmallVector<ValueDecl *, 2> decls;
- auto resolver = DC.getASTContext().getLazyResolver();
- if (!DC.lookupQualified(baseTy, name, NL_QualifiedDefault, resolver, decls))
- return;
-
- for (auto *VD : decls) {
- if ((!isa<AbstractFunctionDecl>(VD) && !isa<SubscriptDecl>(VD)) ||
- shouldHideDeclFromCompletionResults(VD))
- continue;
- resolver->resolveDeclSignature(VD);
- if (!VD->hasInterfaceType())
- continue;
- Type declaredMemberType = VD->getInterfaceType();
- if (auto *AFD = dyn_cast<AbstractFunctionDecl>(VD))
- if (AFD->getDeclContext()->isTypeContext())
- declaredMemberType = AFD->getMethodInterfaceType();
-
- auto fnType =
- baseTy->getTypeOfMember(DC.getParentModule(), VD, declaredMemberType);
-
- if (!fnType || fnType->hasError())
- continue;
- if (auto *AFT = fnType->getAs<AnyFunctionType>()) {
- candidates.push_back(AFT->getParams());
- }
- }
- }
-
- static void collectPossibleParamListByQualifiedLookup(
- DeclContext &DC, Expr *baseExpr, DeclBaseName name,
- SmallVectorImpl<FunctionParams> &candidates) {
- ConcreteDeclRef ref = nullptr;
- auto baseTyOpt = getTypeOfCompletionContextExpr(
- DC.getASTContext(), &DC, CompletionTypeCheckKind::Normal, baseExpr,
- ref);
- if (!baseTyOpt)
- return;
- auto baseTy = (*baseTyOpt)->getRValueType()->getMetatypeInstanceType();
- if (!baseTy->mayHaveMembers())
- return;
-
- collectPossibleParamListByQualifiedLookup(DC, baseTy, name, candidates);
- }
-
- static bool
- collectPossibleParamListsApply(DeclContext &DC, ApplyExpr *callExpr,
- SmallVectorImpl<FunctionParams> &candidates) {
- auto *fnExpr = callExpr->getFn();
-
- if (auto type = fnExpr->getType()) {
- if (auto *funcType = type->getAs<AnyFunctionType>())
- candidates.push_back(funcType->getParams());
- } else if (auto *DRE = dyn_cast<DeclRefExpr>(fnExpr)) {
- if (auto *decl = DRE->getDecl()) {
- auto declType = decl->getInterfaceType();
- if (auto *funcType = declType->getAs<AnyFunctionType>())
- candidates.push_back(funcType->getParams());
- }
- } else if (auto *OSRE = dyn_cast<OverloadSetRefExpr>(fnExpr)) {
- for (auto *decl : OSRE->getDecls()) {
- auto declType = decl->getInterfaceType();
- if (auto *funcType = declType->getAs<AnyFunctionType>())
- candidates.push_back(funcType->getParams());
- }
- } else if (auto *UDE = dyn_cast<UnresolvedDotExpr>(fnExpr)) {
- collectPossibleParamListByQualifiedLookup(
- DC, UDE->getBase(), UDE->getName().getBaseName(), candidates);
- }
-
- if (candidates.empty()) {
- ConcreteDeclRef ref = nullptr;
- auto fnType = getTypeOfCompletionContextExpr(
- DC.getASTContext(), &DC, CompletionTypeCheckKind::Normal, fnExpr,
- ref);
- if (!fnType)
- return false;
-
- if (auto *AFT = (*fnType)->getAs<AnyFunctionType>()) {
- candidates.push_back(AFT->getParams());
- } else if (auto *AMT = (*fnType)->getAs<AnyMetatypeType>()) {
- auto baseTy = AMT->getInstanceType();
- if (baseTy->mayHaveMembers())
- collectPossibleParamListByQualifiedLookup(
- DC, baseTy, DeclBaseName::createConstructor(), candidates);
- }
- }
-
- return !candidates.empty();
- }
-
- static bool collectPossibleParamListsSubscript(
- DeclContext &DC, SubscriptExpr *subscriptExpr,
- SmallVectorImpl<FunctionParams> &candidates) {
- if (subscriptExpr->hasDecl()) {
- if (auto SD =
- dyn_cast<SubscriptDecl>(subscriptExpr->getDecl().getDecl())) {
- auto declType = SD->getInterfaceType();
- if (auto *funcType = declType->getAs<AnyFunctionType>())
- candidates.push_back(funcType->getParams());
- }
- } else {
- collectPossibleParamListByQualifiedLookup(DC, subscriptExpr->getBase(),
- DeclBaseName::createSubscript(),
- candidates);
- }
- return !candidates.empty();
- }
-
- static bool getPositionInArgs(DeclContext &DC, Expr *Args, Expr *CCExpr,
- unsigned &Position, bool &HasName) {
- if (auto TSE = dyn_cast<TupleShuffleExpr>(Args))
- Args = TSE->getSubExpr();
-
- if (isa<ParenExpr>(Args)) {
- HasName = false;
- Position = 0;
- return true;
- }
-
- auto *tuple = dyn_cast<TupleExpr>(Args);
- if (!tuple)
- return false;
-
- auto &SM = DC.getASTContext().SourceMgr;
- for (unsigned i = 0, n = tuple->getNumElements(); i != n; ++i) {
- if (SM.isBeforeInBuffer(tuple->getElement(i)->getEndLoc(),
- CCExpr->getStartLoc()))
- continue;
- HasName = tuple->getElementNameLoc(i).isValid();
- Position = i;
- return true;
- }
- return false;
- }
-
- /// Translate argument index in \p Args to parameter index.
- /// Does nothing unless \p Args is \c TupleShuffleExpr.
- static bool translateArgIndexToParamIndex(Expr *Args,
- unsigned &Position, bool &HasName) {
- auto TSE = dyn_cast<TupleShuffleExpr>(Args);
- if (!TSE)
- return true;
-
- auto mapping = TSE->getElementMapping();
- for (unsigned destIdx = 0, e = mapping.size(); destIdx != e; ++destIdx) {
- auto srcIdx = mapping[destIdx];
- if (srcIdx == (signed)Position) {
- Position = destIdx;
- return true;
- }
- if (srcIdx == TupleShuffleExpr::Variadic &&
- llvm::is_contained(TSE->getVariadicArgs(), Position)) {
- // The arg is a part of variadic args.
- Position = destIdx;
- HasName = false;
- if (auto Args = dyn_cast<TupleExpr>(TSE->getSubExpr())) {
- // Check if the first variadiac argument has the label.
- auto firstVarArgIdx = TSE->getVariadicArgs().front();
- HasName = Args->getElementNameLoc(firstVarArgIdx).isValid();
- }
- return true;
- }
- }
-
- return false;
- }
-
- static bool
- collectArgumentExpectation(DeclContext &DC, Expr *E, Expr *CCExpr,
- std::vector<Type> &ExpectedTypes,
- std::vector<StringRef> &ExpectedNames) {
- // Collect parameter lists for possible func decls.
- SmallVector<FunctionParams, 4> Candidates;
- Expr *Arg = nullptr;
- if (auto *applyExpr = dyn_cast<ApplyExpr>(E)) {
- if (!collectPossibleParamListsApply(DC, applyExpr, Candidates))
- return false;
- Arg = applyExpr->getArg();
- } else if (auto *subscriptExpr = dyn_cast<SubscriptExpr>(E)) {
- if (!collectPossibleParamListsSubscript(DC, subscriptExpr, Candidates))
- return false;
- Arg = subscriptExpr->getIndex();
- }
-
- // Determine the position of code completion token in call argument.
- unsigned Position;
- bool HasName;
- if (!getPositionInArgs(DC, Arg, CCExpr, Position, HasName))
- return false;
- if (!translateArgIndexToParamIndex(Arg, Position, HasName))
- return false;
-
- // Collect possible types (or labels) at the position.
- {
- bool MayNeedName = !HasName && !E->isImplicit() &&
- (isa<CallExpr>(E) | isa<SubscriptExpr>(E));
- SmallPtrSet<TypeBase *, 4> seenTypes;
- SmallPtrSet<Identifier, 4> seenNames;
- for (auto Params : Candidates) {
- if (Position >= Params.size())
- continue;
- const auto &Param = Params[Position];
- if (Param.hasLabel() && MayNeedName) {
- if (seenNames.insert(Param.getLabel()).second)
- ExpectedNames.push_back(Param.getLabel().str());
- } else {
- if (seenTypes.insert(Param.getOldType().getPointer()).second)
- ExpectedTypes.push_back(Param.getOldType());
- }
- }
- }
- return !ExpectedTypes.empty() || !ExpectedNames.empty();
- }
-
void getTypeContextEnumElementCompletions(SourceLoc Loc) {
llvm::SaveAndRestore<LookupKind> ChangeLookupKind(
Kind, LookupKind::EnumElement);
@@ -5312,6 +4970,187 @@
};
} // end anonymous namespace
+namespace {
+using FunctionTypeAndDecl = std::pair<AnyFunctionType *, ValueDecl *>;
+
+/// Collect function (or subscript) members with the given \p name on \p baseTy.
+void collectPossibleCalleesByQualifiedLookup(
+ DeclContext &DC, Type baseTy, DeclBaseName name,
+ SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
+
+ SmallVector<ValueDecl *, 2> decls;
+ auto resolver = DC.getASTContext().getLazyResolver();
+ if (!DC.lookupQualified(baseTy, name, NL_QualifiedDefault, resolver, decls))
+ return;
+
+ for (auto *VD : decls) {
+ if ((!isa<AbstractFunctionDecl>(VD) && !isa<SubscriptDecl>(VD)) ||
+ shouldHideDeclFromCompletionResults(VD))
+ continue;
+ resolver->resolveDeclSignature(VD);
+ if (!VD->hasInterfaceType())
+ continue;
+ Type declaredMemberType = VD->getInterfaceType();
+ if (auto *AFD = dyn_cast<AbstractFunctionDecl>(VD))
+ if (AFD->getDeclContext()->isTypeContext())
+ declaredMemberType =
+ declaredMemberType->castTo<AnyFunctionType>()->getResult();
+
+ auto fnType =
+ baseTy->getTypeOfMember(DC.getParentModule(), VD, declaredMemberType);
+
+ if (!fnType)
+ continue;
+ if (auto *AFT = fnType->getAs<AnyFunctionType>()) {
+ candidates.emplace_back(AFT, VD);
+ }
+ }
+}
+
+/// Collect function (or subscript) members with the given \p name on
+/// \p baseExpr expression.
+void collectPossibleCalleesByQualifiedLookup(
+ DeclContext &DC, Expr *baseExpr, DeclBaseName name,
+ SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
+ ConcreteDeclRef ref = nullptr;
+ auto baseTyOpt = getTypeOfCompletionContextExpr(
+ DC.getASTContext(), &DC, CompletionTypeCheckKind::Normal, baseExpr, ref);
+ if (!baseTyOpt)
+ return;
+ auto baseTy = (*baseTyOpt)->getRValueType()->getMetatypeInstanceType();
+ if (!baseTy->mayHaveMembers())
+ return;
+
+ collectPossibleCalleesByQualifiedLookup(DC, baseTy, name, candidates);
+}
+
+/// For the given \c callExpr, collect possible callee types and declarations.
+bool collectPossibleCalleesForApply(
+ DeclContext &DC, ApplyExpr *callExpr,
+ SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
+ auto *fnExpr = callExpr->getFn();
+
+ if (auto type = fnExpr->getType()) {
+ if (auto *funcType = type->getAs<AnyFunctionType>())
+ candidates.emplace_back(funcType, fnExpr->getReferencedDecl().getDecl());
+ } else if (auto *DRE = dyn_cast<DeclRefExpr>(fnExpr)) {
+ if (auto *decl = DRE->getDecl()) {
+ auto declType = decl->getInterfaceType();
+ if (auto *funcType = declType->getAs<AnyFunctionType>())
+ candidates.emplace_back(funcType, decl);
+ }
+ } else if (auto *OSRE = dyn_cast<OverloadSetRefExpr>(fnExpr)) {
+ for (auto *decl : OSRE->getDecls()) {
+ auto declType = decl->getInterfaceType();
+ if (auto *funcType = declType->getAs<AnyFunctionType>())
+ candidates.emplace_back(funcType, decl);
+ }
+ } else if (auto *UDE = dyn_cast<UnresolvedDotExpr>(fnExpr)) {
+ collectPossibleCalleesByQualifiedLookup(
+ DC, UDE->getBase(), UDE->getName().getBaseName(), candidates);
+ }
+
+ if (candidates.empty()) {
+ ConcreteDeclRef ref = nullptr;
+ auto fnType = getTypeOfCompletionContextExpr(
+ DC.getASTContext(), &DC, CompletionTypeCheckKind::Normal, fnExpr, ref);
+ if (!fnType)
+ return false;
+
+ if (auto *AFT = (*fnType)->getAs<AnyFunctionType>()) {
+ candidates.emplace_back(AFT, ref.getDecl());
+ } else if (auto *AMT = (*fnType)->getAs<AnyMetatypeType>()) {
+ auto baseTy = AMT->getInstanceType();
+ if (baseTy->mayHaveMembers())
+ collectPossibleCalleesByQualifiedLookup(
+ DC, baseTy, DeclBaseName::createConstructor(), candidates);
+ }
+ }
+
+ return !candidates.empty();
+}
+
+/// For the given \c subscriptExpr, collect possible callee types and
+/// declarations.
+bool collectPossibleCalleesForSubscript(
+ DeclContext &DC, SubscriptExpr *subscriptExpr,
+ SmallVectorImpl<FunctionTypeAndDecl> &candidates) {
+ if (subscriptExpr->hasDecl()) {
+ if (auto SD = dyn_cast<SubscriptDecl>(subscriptExpr->getDecl().getDecl())) {
+ auto declType = SD->getInterfaceType();
+ if (auto *funcType = declType->getAs<AnyFunctionType>())
+ candidates.emplace_back(funcType, SD);
+ }
+ } else {
+ collectPossibleCalleesByQualifiedLookup(DC, subscriptExpr->getBase(),
+ DeclBaseName::createSubscript(),
+ candidates);
+ }
+ return !candidates.empty();
+}
+
+/// Get index of \p CCExpr in \p Args. \p Args is usually a \c TupleExpr,
+/// \c ParenExpr, or a \c TupleShuffleExpr.
+/// \returns \c true if success, \c false if \p CCExpr is not a part of \p Args.
+bool getPositionInArgs(DeclContext &DC, Expr *Args, Expr *CCExpr,
+ unsigned &Position, bool &HasName) {
+ if (auto TSE = dyn_cast<TupleShuffleExpr>(Args))
+ Args = TSE->getSubExpr();
+
+ if (isa<ParenExpr>(Args)) {
+ HasName = false;
+ Position = 0;
+ return true;
+ }
+
+ auto *tuple = dyn_cast<TupleExpr>(Args);
+ if (!tuple)
+ return false;
+
+ auto &SM = DC.getASTContext().SourceMgr;
+ for (unsigned i = 0, n = tuple->getNumElements(); i != n; ++i) {
+ if (SM.isBeforeInBuffer(tuple->getElement(i)->getEndLoc(),
+ CCExpr->getStartLoc()))
+ continue;
+ HasName = tuple->getElementNameLoc(i).isValid();
+ Position = i;
+ return true;
+ }
+ return false;
+}
+
+/// Translate argument index in \p Args to parameter index.
+/// Does nothing unless \p Args is \c TupleShuffleExpr.
+bool translateArgIndexToParamIndex(Expr *Args, unsigned &Position,
+ bool &HasName) {
+ auto TSE = dyn_cast<TupleShuffleExpr>(Args);
+ if (!TSE)
+ return true;
+
+ auto mapping = TSE->getElementMapping();
+ for (unsigned destIdx = 0, e = mapping.size(); destIdx != e; ++destIdx) {
+ auto srcIdx = mapping[destIdx];
+ if (srcIdx == (signed)Position) {
+ Position = destIdx;
+ return true;
+ }
+ if (srcIdx == TupleShuffleExpr::Variadic &&
+ llvm::is_contained(TSE->getVariadicArgs(), Position)) {
+ // The arg is a part of variadic args.
+ Position = destIdx;
+ HasName = false;
+ if (auto Args = dyn_cast<TupleExpr>(TSE->getSubExpr())) {
+ // Check if the first variadiac argument has the label.
+ auto firstVarArgIdx = TSE->getVariadicArgs().front();
+ HasName = Args->getElementNameLoc(firstVarArgIdx).isValid();
+ }
+ return true;
+ }
+ }
+
+ return false;
+}
+
/// Given an expression and its context, the analyzer tries to figure out the
/// expected type of the expression by analyzing its context.
class CodeCompletionTypeContextAnalyzer {
@@ -5321,6 +5160,68 @@
ASTContext &Context;
ExprParentFinder Finder;
+ // Results populated by Analyze()
+ SmallVector<Type, 2> PossibleTypes;
+ SmallVector<StringRef, 2> PossibleNames;
+ SmallVector<FunctionTypeAndDecl, 2> PossibleCallees;
+
+ void recordPossibleType(Type ty) {
+ if (!ty || ty->is<ErrorType>())
+ return;
+ PossibleTypes.push_back(ty->getRValueType());
+ }
+
+ void recordPossibleName(StringRef name) {
+ PossibleNames.push_back(name);
+ }
+
+ /// Collect context information at call argument position.
+ bool collectArgumentExpectation(DeclContext &DC, Expr *E, Expr *CCExpr) {
+ // Collect parameter lists for possible func decls.
+ SmallVector<FunctionTypeAndDecl, 2> Candidates;
+ Expr *Arg = nullptr;
+ if (auto *applyExpr = dyn_cast<ApplyExpr>(E)) {
+ if (!collectPossibleCalleesForApply(DC, applyExpr, Candidates))
+ return false;
+ Arg = applyExpr->getArg();
+ } else if (auto *subscriptExpr = dyn_cast<SubscriptExpr>(E)) {
+ if (!collectPossibleCalleesForSubscript(DC, subscriptExpr, Candidates))
+ return false;
+ Arg = subscriptExpr->getIndex();
+ }
+ PossibleCallees.assign(Candidates.begin(), Candidates.end());
+
+ // Determine the position of code completion token in call argument.
+ unsigned Position;
+ bool HasName;
+ if (!getPositionInArgs(DC, Arg, CCExpr, Position, HasName))
+ return false;
+ if (!translateArgIndexToParamIndex(Arg, Position, HasName))
+ return false;
+
+ // Collect possible types (or labels) at the position.
+ {
+ bool MayNeedName = !HasName && !E->isImplicit() &&
+ (isa<CallExpr>(E) | isa<SubscriptExpr>(E));
+ SmallPtrSet<TypeBase *, 4> seenTypes;
+ SmallPtrSet<Identifier, 4> seenNames;
+ for (auto &typeAndDecl : Candidates) {
+ auto Params = typeAndDecl.first->getParams();
+ if (Position >= Params.size())
+ continue;
+ const auto &Param = Params[Position];
+ if (Param.hasLabel() && MayNeedName) {
+ if (seenNames.insert(Param.getLabel()).second)
+ recordPossibleName(Param.getLabel().str());
+ } else {
+ if (seenTypes.insert(Param.getOldType().getPointer()).second)
+ recordPossibleType(Param.getOldType());
+ }
+ }
+ }
+ return !PossibleTypes.empty() || !PossibleNames.empty();
+ }
+
public:
CodeCompletionTypeContextAnalyzer(DeclContext *DC, Expr *ParsedExpr) : DC(DC),
ParsedExpr(ParsedExpr), SM(DC->getASTContext().SourceMgr),
@@ -5374,21 +5275,13 @@
return false;
}) {}
- void analyzeExpr(Expr *Parent, llvm::function_ref<void(Type)> Callback,
- SmallVectorImpl<StringRef> &PossibleNames) {
+ void analyzeExpr(Expr *Parent) {
switch (Parent->getKind()) {
case ExprKind::Call:
case ExprKind::Subscript:
case ExprKind::Binary:
case ExprKind::PrefixUnary: {
- std::vector<Type> PotentialTypes;
- std::vector<StringRef> ExpectedNames;
- CompletionLookup::collectArgumentExpectation(
- *DC, Parent, ParsedExpr, PotentialTypes, ExpectedNames);
- for (Type Ty : PotentialTypes)
- Callback(Ty);
- for (auto name : ExpectedNames)
- PossibleNames.push_back(name);
+ collectArgumentExpectation(*DC, Parent, ParsedExpr);
break;
}
case ExprKind::Assign: {
@@ -5401,10 +5294,10 @@
// The destination is of the expected type.
auto *destExpr = AE->getDest();
if (auto type = destExpr->getType()) {
- Callback(type);
+ recordPossibleType(type);
} else if (auto *DRE = dyn_cast<DeclRefExpr>(destExpr)) {
if (auto *decl = DRE->getDecl())
- Callback(decl->getInterfaceType());
+ recordPossibleType(decl->getInterfaceType());
}
}
break;
@@ -5414,8 +5307,9 @@
return;
unsigned Position = 0;
bool HasName;
- if (CompletionLookup::getPositionInArgs(*DC, Parent, ParsedExpr, Position, HasName)) {
- Callback(Parent->getType()->castTo<TupleType>()->getElementType(Position));
+ if (getPositionInArgs(*DC, Parent, ParsedExpr, Position, HasName)) {
+ recordPossibleType(
+ Parent->getType()->castTo<TupleType>()->getElementType(Position));
}
break;
}
@@ -5424,15 +5318,16 @@
}
}
- void analyzeStmt(Stmt *Parent, llvm::function_ref<void(Type)> Callback) {
+ void analyzeStmt(Stmt *Parent) {
switch (Parent->getKind()) {
case StmtKind::Return:
- Callback(getReturnTypeFromContext(DC));
+ recordPossibleType(getReturnTypeFromContext(DC));
break;
case StmtKind::ForEach:
if (auto SEQ = cast<ForEachStmt>(Parent)->getSequence()) {
if (containsTarget(SEQ)) {
- Callback(Context.getSequenceDecl()->getDeclaredInterfaceType());
+ recordPossibleType(
+ Context.getSequenceDecl()->getDeclaredInterfaceType());
}
}
break;
@@ -5441,7 +5336,7 @@
case StmtKind::While:
case StmtKind::Guard:
if (isBoolConditionOf(Parent)) {
- Callback(Context.getBoolDecl()->getDeclaredInterfaceType());
+ recordPossibleType(Context.getBoolDecl()->getDeclaredInterfaceType());
}
break;
default:
@@ -5470,7 +5365,7 @@
return SM.rangeContains(E->getSourceRange(), ParsedExpr->getSourceRange());
}
- void analyzeDecl(Decl *D, llvm::function_ref<void(Type)> Callback) {
+ void analyzeDecl(Decl *D) {
switch (D->getKind()) {
case DeclKind::PatternBinding: {
auto PBD = cast<PatternBindingDecl>(D);
@@ -5478,7 +5373,7 @@
if (auto Init = PBD->getInit(I)) {
if (containsTarget(Init)) {
if (PBD->getPattern(I)->hasType()) {
- Callback(PBD->getPattern(I)->getType());
+ recordPossibleType(PBD->getPattern(I)->getType());
break;
}
}
@@ -5491,13 +5386,13 @@
}
}
- void analyzePattern(Pattern *P, llvm::function_ref<void(Type)> Callback) {
+ void analyzePattern(Pattern *P) {
switch (P->getKind()) {
case PatternKind::Expr: {
auto ExprPat = cast<ExprPattern>(P);
if (auto D = ExprPat->getMatchVar()) {
if (D->hasInterfaceType())
- Callback(D->getInterfaceType());
+ recordPossibleType(D->getInterfaceType());
}
break;
}
@@ -5506,40 +5401,38 @@
}
}
- bool Analyze(llvm::SmallVectorImpl<Type> &PossibleTypes) {
- SmallVector<StringRef, 1> PossibleNames;
- return Analyze(PossibleTypes, PossibleNames) && !PossibleTypes.empty();
- }
- bool Analyze(SmallVectorImpl<Type> &PossibleTypes,
- SmallVectorImpl<StringRef> &PossibleNames) {
+ bool Analyze() {
// We cannot analyze without target.
if (!ParsedExpr)
return false;
DC->walkContext(Finder);
- auto Callback = [&] (Type Result) {
- if (Result &&
- Result->getKind() != TypeKind::Error)
- PossibleTypes.push_back(Result->getRValueType());
- };
for (auto It = Finder.Ancestors.rbegin(); It != Finder.Ancestors.rend();
++ It) {
if (auto Parent = It->getAsExpr()) {
- analyzeExpr(Parent, Callback, PossibleNames);
+ analyzeExpr(Parent);
} else if (auto Parent = It->getAsStmt()) {
- analyzeStmt(Parent, Callback);
+ analyzeStmt(Parent);
} else if (auto Parent = It->getAsDecl()) {
- analyzeDecl(Parent, Callback);
+ analyzeDecl(Parent);
} else if (auto Parent = It->getAsPattern()) {
- analyzePattern(Parent, Callback);
+ analyzePattern(Parent);
}
if (!PossibleTypes.empty() || !PossibleNames.empty())
return true;
}
return false;
}
+
+ ArrayRef<Type> getPossibleTypes() const { return PossibleTypes; }
+ ArrayRef<StringRef> getPossibleNames() const { return PossibleNames; }
+ ArrayRef<FunctionTypeAndDecl> getPossibleCallees() const {
+ return PossibleCallees;
+ }
};
+} // end anonymous namespace
+
void CodeCompletionCallbacksImpl::doneParsing() {
CompletionContext.CodeCompletionKind = Kind;
@@ -5632,9 +5525,8 @@
::CodeCompletionTypeContextAnalyzer TypeAnalyzer(CurDeclContext,
ParsedExpr);
- llvm::SmallVector<Type, 2> PossibleTypes;
- if (TypeAnalyzer.Analyze(PossibleTypes)) {
- Lookup.setExpectedTypes(PossibleTypes);
+ if (TypeAnalyzer.Analyze()) {
+ Lookup.setExpectedTypes(TypeAnalyzer.getPossibleTypes());
}
Lookup.getValueExprCompletions(*ExprType, ReferencedDecl.getDecl());
break;
@@ -5677,9 +5569,8 @@
case CompletionKind::PostfixExprBeginning: {
::CodeCompletionTypeContextAnalyzer Analyzer(CurDeclContext,
CodeCompleteTokenExpr);
- llvm::SmallVector<Type, 1> Types;
- if (Analyzer.Analyze(Types)) {
- Lookup.setExpectedTypes(Types);
+ if (Analyzer.Analyze()) {
+ Lookup.setExpectedTypes(Analyzer.getPossibleTypes());
}
DoPostfixExprBeginning();
break;
@@ -5705,19 +5596,20 @@
::CodeCompletionTypeContextAnalyzer TypeAnalyzer(CurDeclContext,
CodeCompleteTokenExpr);
- SmallVector<Type, 2> PossibleTypes;
- SmallVector<StringRef, 2> PossibleNames;
- if (TypeAnalyzer.Analyze(PossibleTypes, PossibleNames)) {
- Lookup.setExpectedTypes(PossibleTypes);
+ if (TypeAnalyzer.Analyze()) {
+ Lookup.setExpectedTypes(TypeAnalyzer.getPossibleTypes());
}
- if (ExprType) {
- if (ShouldCompleteCallPatternAfterParen) {
+ if (ShouldCompleteCallPatternAfterParen) {
+ if (ExprType) {
Lookup.getValueExprCompletions(*ExprType, ReferencedDecl.getDecl());
} else {
- // Add argument labels, then fallthrough to get values.
- Lookup.addArgNameCompletionResults(PossibleNames);
+ for (auto &typeAndDecl : TypeAnalyzer.getPossibleCallees())
+ Lookup.getValueExprCompletions(typeAndDecl.first, typeAndDecl.second);
}
+ } else {
+ // Add argument labels, then fallthrough to get values.
+ Lookup.addArgNameCompletionResults(TypeAnalyzer.getPossibleNames());
}
if (!Lookup.FoundFunctionCalls ||
@@ -5827,12 +5719,11 @@
}
case CompletionKind::UnresolvedMember: {
Lookup.setHaveDot(DotLoc);
- SmallVector<Type, 2> PossibleTypes;
::CodeCompletionTypeContextAnalyzer TypeAnalyzer(CurDeclContext,
CodeCompleteTokenExpr);
- if (TypeAnalyzer.Analyze(PossibleTypes))
- Lookup.setExpectedTypes(PossibleTypes);
- Lookup.getUnresolvedMemberCompletions(PossibleTypes);
+ if (TypeAnalyzer.Analyze())
+ Lookup.setExpectedTypes(TypeAnalyzer.getPossibleTypes());
+ Lookup.getUnresolvedMemberCompletions(TypeAnalyzer.getPossibleTypes());
break;
}
case CompletionKind::AssignmentRHS : {
@@ -5845,14 +5736,12 @@
case CompletionKind::CallArg : {
::CodeCompletionTypeContextAnalyzer Analyzer(CurDeclContext,
CodeCompleteTokenExpr);
- SmallVector<Type, 2> PossibleTypes;
- SmallVector<StringRef, 2> PossibleNames;
- Analyzer.Analyze(PossibleTypes, PossibleNames);
- if (!PossibleNames.empty()) {
- Lookup.addArgNameCompletionResults(PossibleNames);
+ Analyzer.Analyze();
+ if (!Analyzer.getPossibleNames().empty()) {
+ Lookup.addArgNameCompletionResults(Analyzer.getPossibleNames());
break;
}
- Lookup.setExpectedTypes(PossibleTypes);
+ Lookup.setExpectedTypes(Analyzer.getPossibleTypes());
DoPostfixExprBeginning();
break;
}
diff --git a/lib/IRGen/DebugTypeInfo.h b/lib/IRGen/DebugTypeInfo.h
index 0edc394..5f0e4fe 100644
--- a/lib/IRGen/DebugTypeInfo.h
+++ b/lib/IRGen/DebugTypeInfo.h
@@ -88,14 +88,6 @@
return Type->getWithoutSpecifierType()->is<ArchetypeType>();
}
- /// LValues, inout args, and Archetypes are implicitly indirect by
- /// virtue of their DWARF type.
- //
- // FIXME: There exists an inverse workaround in LLDB. Both should be removed.
- bool isImplicitlyIndirect() const {
- return isArchetype();
- }
-
bool isNull() const { return Type == nullptr; }
bool operator==(DebugTypeInfo T) const;
bool operator!=(DebugTypeInfo T) const;
diff --git a/lib/IRGen/EnumPayload.cpp b/lib/IRGen/EnumPayload.cpp
index 82bd130..c3c455f 100644
--- a/lib/IRGen/EnumPayload.cpp
+++ b/lib/IRGen/EnumPayload.cpp
@@ -719,9 +719,10 @@
llvm::Value *newBits;
if (u > usedBits)
newBits = IGF.Builder.CreateLShr(spareBits, u - usedBits);
- else if (u < usedBits)
- newBits = IGF.Builder.CreateShl(spareBits, usedBits - u);
- else
+ else if (u < usedBits) {
+ newBits = IGF.Builder.CreateZExtOrTrunc(spareBits, destTy);
+ newBits = IGF.Builder.CreateShl(newBits, usedBits - u);
+ } else
newBits = spareBits;
newBits = IGF.Builder.CreateZExtOrTrunc(newBits, destTy);
diff --git a/lib/IRGen/Fulfillment.cpp b/lib/IRGen/Fulfillment.cpp
index 3285be7..90c1ca3 100644
--- a/lib/IRGen/Fulfillment.cpp
+++ b/lib/IRGen/Fulfillment.cpp
@@ -124,6 +124,14 @@
source, MetadataPath(path), keys);
}
+ // Consider its super class bound.
+ if (metadataState == MetadataState::Complete) {
+ if (auto superclassTy = keys.getSuperclassBound(type)) {
+ hadFulfillment |= searchNominalTypeMetadata(
+ IGM, superclassTy, metadataState, source, std::move(path), keys);
+ }
+ }
+
// Add the fulfillment.
hadFulfillment |= addFulfillment({type, nullptr},
source, std::move(path), metadataState);
diff --git a/lib/IRGen/GenDecl.cpp b/lib/IRGen/GenDecl.cpp
index b22959b..c0b5c9c 100644
--- a/lib/IRGen/GenDecl.cpp
+++ b/lib/IRGen/GenDecl.cpp
@@ -1184,7 +1184,12 @@
// Try to create a new record of the fact that we used this type.
auto insertResult = LazyTypeGlobals.try_emplace(type);
auto &entry = insertResult.first->second;
-
+
+ // Imported structs and enums types are known to be lazy.
+ if (insertResult.second) {
+ entry.IsLazy = requiresForeignTypeMetadata(type);
+ }
+
bool metadataWasUsed = entry.IsMetadataUsed;
bool descriptorWasUsed = entry.IsDescriptorUsed;
diff --git a/lib/IRGen/GenEnum.cpp b/lib/IRGen/GenEnum.cpp
index adb46c1..c1caaff 100644
--- a/lib/IRGen/GenEnum.cpp
+++ b/lib/IRGen/GenEnum.cpp
@@ -4844,6 +4844,31 @@
}
return addr;
}
+
+ // If there are common spare bits we didn't use for tags, rotate the
+ // extra inhabitant values so that the used tag bits are at the bottom.
+ // This will cleanly separate the used tag values from the extra inhabitants
+ // so we can discriminate them with one comparison. The tag favors high
+ // bits, whereas extra inhabitants count down from -1 using all bits
+ // (capping out at up to 32 spare bits, in which case the lowest 32
+ // bits are used).
+ std::pair<unsigned, unsigned> getRotationAmountsForExtraInhabitants() const{
+ assert([&]{
+ auto maskedBits = PayloadTagBits;
+ maskedBits &= CommonSpareBits;
+ return maskedBits == PayloadTagBits;
+ }());
+
+ unsigned commonSpareBitsCount = CommonSpareBits.count();
+ unsigned payloadTagBitsCount = PayloadTagBits.count();
+ if (commonSpareBitsCount == payloadTagBitsCount
+ || commonSpareBitsCount - payloadTagBitsCount >= 32) {
+ return std::make_pair(0, 0);
+ }
+ unsigned shlAmount = commonSpareBitsCount - payloadTagBitsCount;
+ unsigned shrAmount = std::min(commonSpareBitsCount, 32u) - shlAmount;
+ return {shlAmount, shrAmount};
+ }
llvm::Value *getExtraInhabitantIndex(IRGenFunction &IGF,
Address src,
@@ -4859,6 +4884,32 @@
auto payload = EnumPayload::load(IGF, projectPayload(IGF, src),
PayloadSchema);
tag = payload.emitGatherSpareBits(IGF, CommonSpareBits, 0, 32);
+
+ // If there are common spare bits we didn't use for tags, rotate the
+ // tag value so that the used tag bits are at the bottom. This will
+ // cleanly separate the used tag values from the extra inhabitants so
+ // we can discriminate them with one comparison. The tag favors high
+ // bits, whereas extra inhabitants count down from -1 using all bits
+ // (capping out at up to 32 spare bits, in which case the lowest 32
+ // bits are used).
+ //
+ // Note that since this is the inverse operation--we're taking the bits
+ // out of a payload and mapping them back to an extra inhabitant index--
+ // the `shr` and `shl` amounts are intentionally swapped here.
+ unsigned shrAmount, shlAmount;
+ std::tie(shrAmount, shlAmount) = getRotationAmountsForExtraInhabitants();
+ if (shrAmount != 0) {
+ assert(getExtraTagBitCountForExtraInhabitants() == 0);
+ auto tagLo = IGF.Builder.CreateLShr(tag, shrAmount);
+ auto tagHi = IGF.Builder.CreateShl(tag, shlAmount);
+ tag = IGF.Builder.CreateOr(tagLo, tagHi);
+ if (CommonSpareBits.count() < 32) {
+ auto mask = llvm::ConstantInt::get(IGF.IGM.Int32Ty,
+ (1u << CommonSpareBits.count()) - 1u);
+ tag = IGF.Builder.CreateAnd(tag, mask);
+ }
+ }
+
if (getExtraTagBitCountForExtraInhabitants()) {
auto extraTagAddr = projectExtraTagBitsForExtraInhabitants(IGF, src);
auto extraTag = IGF.Builder.CreateLoad(extraTagAddr);
@@ -4899,6 +4950,29 @@
}
auto indexValue = IGF.Builder.CreateNot(index);
+
+ // If there are common spare bits we didn't use for tags, rotate the
+ // tag value so that the used tag bits are at the bottom. This will
+ // cleanly separate the used tag values from the extra inhabitants so
+ // we can discriminate them with one comparison. The tag favors high
+ // bits, whereas extra inhabitants count down from -1 using all bits
+ // (capping out at up to 32 spare bits, in which case the lowest 32
+ // bits are used).
+ unsigned shlAmount, shrAmount;
+ std::tie(shlAmount, shrAmount) = getRotationAmountsForExtraInhabitants();
+
+ if (shlAmount != 0) {
+ assert(getExtraTagBitCountForExtraInhabitants() == 0);
+ if (CommonSpareBits.count() < 32) {
+ auto mask = llvm::ConstantInt::get(IGF.IGM.Int32Ty,
+ (1u << CommonSpareBits.count()) - 1u);
+ indexValue = IGF.Builder.CreateAnd(indexValue, mask);
+ }
+ auto indexValueHi = IGF.Builder.CreateShl(indexValue, shlAmount);
+ auto indexValueLo = IGF.Builder.CreateLShr(indexValue, shrAmount);
+ indexValue = IGF.Builder.CreateOr(indexValueHi, indexValueLo);
+ }
+
if (CommonSpareBits.count()) {
// Factor the index value into parts to scatter into the payload and
// to store in the extra tag bits, if any.
@@ -4952,6 +5026,25 @@
// Count down from all-ones since a small negative number constant is
// likely to be easier to reify.
auto mask = ~index;
+
+ // If there are common spare bits we didn't use for tags, rotate the
+ // tag value so that the used tag bits are at the bottom. This will
+ // cleanly separate the used tag values from the extra inhabitants so
+ // we can discriminate them with one comparison. The tag favors high
+ // bits, whereas extra inhabitants count down from -1 using all bits
+ // (capping out at up to 32 spare bits, in which case the lowest 32
+ // bits are used).
+ unsigned shlAmount, shrAmount;
+ std::tie(shlAmount, shrAmount) = getRotationAmountsForExtraInhabitants();
+
+ if (shlAmount != 0) {
+ assert(getExtraTagBitCountForExtraInhabitants() == 0);
+ if (CommonSpareBits.count() < 32) {
+ mask &= (1u << CommonSpareBits.count()) - 1;
+ }
+ mask = (mask >> shrAmount) | (mask << shlAmount);
+ }
+
auto extraTagMask = getExtraTagBitCountForExtraInhabitants() >= 32
? ~0u : (1 << getExtraTagBitCountForExtraInhabitants()) - 1;
diff --git a/lib/IRGen/GenMeta.cpp b/lib/IRGen/GenMeta.cpp
index 313b0f1..4e6e65a 100644
--- a/lib/IRGen/GenMeta.cpp
+++ b/lib/IRGen/GenMeta.cpp
@@ -1675,7 +1675,10 @@
void irgen::emitLazyTypeMetadata(IRGenModule &IGM, NominalTypeDecl *type) {
eraseExistingTypeContextDescriptor(IGM, type);
- if (auto sd = dyn_cast<StructDecl>(type)) {
+ if (requiresForeignTypeMetadata(type)) {
+ (void)IGM.getAddrOfForeignTypeMetadataCandidate(
+ type->getDeclaredInterfaceType()->getCanonicalType());
+ } else if (auto sd = dyn_cast<StructDecl>(type)) {
return emitStructMetadata(IGM, sd);
} else if (auto ed = dyn_cast<EnumDecl>(type)) {
emitEnumMetadata(IGM, ed);
@@ -3878,7 +3881,8 @@
llvm_unreachable("bad foreign class kind");
}
- return isa<ClangModuleUnit>(decl->getModuleScopeContext());
+ return isa<ClangModuleUnit>(decl->getModuleScopeContext()) &&
+ !isa<ProtocolDecl>(decl);
}
llvm::Constant *
diff --git a/lib/IRGen/GenProto.cpp b/lib/IRGen/GenProto.cpp
index ad5e58a..d951a6e 100644
--- a/lib/IRGen/GenProto.cpp
+++ b/lib/IRGen/GenProto.cpp
@@ -2847,16 +2847,23 @@
// If we don't have concrete conformance information, the type must be
// an archetype and the conformance must be via one of the protocol
// requirements of the archetype. Look at what's locally bound.
+ ProtocolConformance *concreteConformance;
if (conformance.isAbstract()) {
- auto archetype = cast<ArchetypeType>(srcType);
- return emitArchetypeWitnessTableRef(IGF, archetype, proto);
- }
+ if (auto archetype = dyn_cast<ArchetypeType>(srcType))
+ return emitArchetypeWitnessTableRef(IGF, archetype, proto);
+
+ // Otherwise, this must be a self-conformance.
+ assert(proto->requiresSelfConformanceWitnessTable());
+ assert(cast<ProtocolType>(srcType)->getDecl() == proto);
+ concreteConformance = IGF.IGM.Context.getSelfConformance(proto);
// All other source types should be concrete enough that we have
// conformance info for them. However, that conformance info might be
// more concrete than we're expecting.
// TODO: make a best effort to devirtualize, maybe?
- auto concreteConformance = conformance.getConcrete();
+ } else {
+ concreteConformance = conformance.getConcrete();
+ }
assert(concreteConformance->getProtocol() == proto);
auto cacheKind =
diff --git a/lib/IRGen/IRGenSIL.cpp b/lib/IRGen/IRGenSIL.cpp
index 0b25690..58d224a 100644
--- a/lib/IRGen/IRGenSIL.cpp
+++ b/lib/IRGen/IRGenSIL.cpp
@@ -3727,8 +3727,7 @@
emitShadowCopyIfNeeded(Addr, i->getDebugScope(), Name, VarInfo->ArgNo,
IsAnonymous),
DbgTy, SILType(), i->getDebugScope(), Decl, Name, VarInfo->ArgNo,
- (IsLoadablyByAddress || DbgTy.isImplicitlyIndirect()) ? DirectValue
- : IndirectValue);
+ (IsLoadablyByAddress) ? DirectValue : IndirectValue);
}
void IRGenSILFunction::visitFixLifetimeInst(swift::FixLifetimeInst *i) {
@@ -3996,10 +3995,6 @@
CurSILFn->getDeclContext(), CurSILFn->getGenericEnvironment(), Decl,
RealType, type);
- // FIXME: This is working around the inverse special case in LLDB.
- if (DbgTy.isImplicitlyIndirect())
- Indirection = DirectValue;
-
bindArchetypes(DbgTy.getType());
if (IGM.DebugInfo)
emitDebugVariableDeclaration(addr, DbgTy, SILTy, DS, Decl, Name,
diff --git a/lib/Parse/Lexer.cpp b/lib/Parse/Lexer.cpp
index e75ccd5..a5acee6 100644
--- a/lib/Parse/Lexer.cpp
+++ b/lib/Parse/Lexer.cpp
@@ -2386,6 +2386,8 @@
case 0:
switch (getNulCharacterKind(CurPtr - 1)) {
case NulCharacterKind::CodeCompletion:
+ while (advanceIfValidContinuationOfIdentifier(CurPtr, BufferEnd))
+ ;
return formToken(tok::code_complete, TokStart);
case NulCharacterKind::BufferEnd:
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 17c73ed..89b691a 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -1207,9 +1207,9 @@
if (canParseAsGenericArgumentList()) {
SmallVector<TypeRepr *, 8> args;
SourceLoc LAngleLoc, RAngleLoc;
- if (parseGenericArguments(args, LAngleLoc, RAngleLoc)) {
+ auto argStat = parseGenericArguments(args, LAngleLoc, RAngleLoc);
+ if (argStat.isError())
diagnose(LAngleLoc, diag::while_parsing_as_left_angle_bracket);
- }
SmallVector<TypeLoc, 8> locArgs;
for (auto ty : args)
@@ -2259,9 +2259,9 @@
if (canParseAsGenericArgumentList()) {
SyntaxContext->createNodeInPlace(SyntaxKind::IdentifierExpr);
SyntaxContext->setCreateSyntax(SyntaxKind::SpecializeExpr);
- if (parseGenericArguments(args, LAngleLoc, RAngleLoc)) {
+ auto argStat = parseGenericArguments(args, LAngleLoc, RAngleLoc);
+ if (argStat.isError())
diagnose(LAngleLoc, diag::while_parsing_as_left_angle_bracket);
- }
// The result can be empty in error cases.
hasGenericArgumentList = !args.empty();
diff --git a/lib/Parse/ParseType.cpp b/lib/Parse/ParseType.cpp
index fa3d2a1..fdf84e6 100644
--- a/lib/Parse/ParseType.cpp
+++ b/lib/Parse/ParseType.cpp
@@ -502,9 +502,9 @@
specifierLoc));
}
-bool Parser::parseGenericArguments(SmallVectorImpl<TypeRepr*> &Args,
- SourceLoc &LAngleLoc,
- SourceLoc &RAngleLoc) {
+ParserStatus Parser::parseGenericArguments(SmallVectorImpl<TypeRepr *> &Args,
+ SourceLoc &LAngleLoc,
+ SourceLoc &RAngleLoc) {
SyntaxParsingContext GenericArgumentsContext(
SyntaxContext, SyntaxKind::GenericArgumentClause);
@@ -523,7 +523,7 @@
if (Ty.isNull() || Ty.hasCodeCompletion()) {
// Skip until we hit the '>'.
RAngleLoc = skipUntilGreaterInTypeList();
- return true;
+ return ParserStatus(Ty);
}
Args.push_back(Ty.get());
@@ -540,12 +540,12 @@
// Skip until we hit the '>'.
RAngleLoc = skipUntilGreaterInTypeList();
- return true;
+ return makeParserError();
} else {
RAngleLoc = consumeStartingGreater();
}
- return false;
+ return makeParserSuccess();
}
/// parseTypeIdentifier
@@ -597,8 +597,9 @@
SourceLoc LAngle, RAngle;
SmallVector<TypeRepr*, 8> GenericArgs;
if (startsWithLess(Tok)) {
- if (parseGenericArguments(GenericArgs, LAngle, RAngle))
- return nullptr;
+ auto genericArgsStatus = parseGenericArguments(GenericArgs, LAngle, RAngle);
+ if (genericArgsStatus.isError())
+ return genericArgsStatus;
}
EndLoc = Loc;
diff --git a/lib/SIL/DynamicCasts.cpp b/lib/SIL/DynamicCasts.cpp
index ab42d95..ac90ac7 100644
--- a/lib/SIL/DynamicCasts.cpp
+++ b/lib/SIL/DynamicCasts.cpp
@@ -107,13 +107,10 @@
if (!SourceNominalTy)
return DynamicCastFeasibility::MaySucceed;
- // If we are casting a protocol, then the cast will fail
- // as we have not found any conformances and protocols cannot
- // be extended currently.
- // NOTE: If we allow protocol extensions in the future, this
- // conditional statement should be removed.
- if (isa<ProtocolType>(source)) {
- return DynamicCastFeasibility::WillFail;
+ // Protocol types may conform to their own protocols (or other protocols)
+ // in the future.
+ if (source->isAnyExistentialType()) {
+ return DynamicCastFeasibility::MaySucceed;
}
// If it is a class and it can be proven that this class and its
@@ -491,7 +488,9 @@
sourceFunction.getResult() == targetFunction.getResult())
return DynamicCastFeasibility::WillSucceed;
- return DynamicCastFeasibility::WillFail;
+ // Be conservative about function type relationships we may add in
+ // the future.
+ return DynamicCastFeasibility::MaySucceed;
}
}
diff --git a/lib/SILGen/SILGen.cpp b/lib/SILGen/SILGen.cpp
index 5a3e11c..f23c479 100644
--- a/lib/SILGen/SILGen.cpp
+++ b/lib/SILGen/SILGen.cpp
@@ -675,10 +675,10 @@
/// Emit a function now, if it's externally usable or has been referenced in
/// the current TU, or remember how to emit it later if not.
template<typename /*void (SILFunction*)*/ Fn>
-void emitOrDelayFunction(SILGenModule &SGM,
- SILDeclRef constant,
- Fn &&emitter,
- bool forceEmission = false) {
+static void emitOrDelayFunction(SILGenModule &SGM,
+ SILDeclRef constant,
+ Fn &&emitter,
+ bool forceEmission = false) {
auto emitAfter = SGM.lastEmittedFunction;
SILFunction *f = nullptr;
@@ -1312,7 +1312,8 @@
case AccessorKind::Read:
return impl.getReadImpl() != ReadImplKind::Read;
case AccessorKind::Set:
- return impl.getWriteImpl() != WriteImplKind::Set;
+ return impl.getWriteImpl() != WriteImplKind::Set &&
+ impl.getWriteImpl() != WriteImplKind::StoredWithObservers;
case AccessorKind::Modify:
return impl.getReadWriteImpl() != ReadWriteImplKind::Modify;
#define ACCESSOR(ID) \
diff --git a/lib/SILGen/SILGen.h b/lib/SILGen/SILGen.h
index 363ba7c..015d083 100644
--- a/lib/SILGen/SILGen.h
+++ b/lib/SILGen/SILGen.h
@@ -307,6 +307,9 @@
/// Emit the default witness table for a resilient protocol.
void emitDefaultWitnessTable(ProtocolDecl *protocol);
+ /// Emit the self-conformance witness table for a protocol.
+ void emitSelfConformanceWitnessTable(ProtocolDecl *protocol);
+
/// Emit the lazy initializer function for a global pattern binding
/// declaration.
SILFunction *emitLazyGlobalInitializer(StringRef funcName,
diff --git a/lib/SILGen/SILGenFunction.h b/lib/SILGen/SILGenFunction.h
index 8e44269..118e66e 100644
--- a/lib/SILGen/SILGenFunction.h
+++ b/lib/SILGen/SILGenFunction.h
@@ -651,7 +651,8 @@
SubstitutionMap reqtSubs,
SILDeclRef witness,
SubstitutionMap witnessSubs,
- IsFreeFunctionWitness_t isFree);
+ IsFreeFunctionWitness_t isFree,
+ bool isSelfConformance);
/// Convert a block to a native function with a thunk.
ManagedValue emitBlockToFunc(SILLocation loc,
diff --git a/lib/SILGen/SILGenPoly.cpp b/lib/SILGen/SILGenPoly.cpp
index 40956d4..4e2bebf 100644
--- a/lib/SILGen/SILGenPoly.cpp
+++ b/lib/SILGen/SILGenPoly.cpp
@@ -3575,15 +3575,23 @@
enum class WitnessDispatchKind {
Static,
Dynamic,
- Class
+ Class,
+ Witness
};
-static WitnessDispatchKind getWitnessDispatchKind(SILDeclRef witness) {
+static WitnessDispatchKind getWitnessDispatchKind(SILDeclRef witness,
+ bool isSelfConformance) {
auto *decl = witness.getDecl();
+ if (isSelfConformance) {
+ assert(isa<ProtocolDecl>(decl->getDeclContext()));
+ return WitnessDispatchKind::Witness;
+ }
+
ClassDecl *C = decl->getDeclContext()->getSelfClassDecl();
- if (!C)
+ if (!C) {
return WitnessDispatchKind::Static;
+ }
// If the witness is dynamic, go through dynamic dispatch.
if (decl->isObjCDynamic()) {
@@ -3630,6 +3638,7 @@
switch (witnessKind) {
case WitnessDispatchKind::Static:
case WitnessDispatchKind::Dynamic:
+ case WitnessDispatchKind::Witness:
return SGM.Types.getConstantInfo(witness).SILFnType;
case WitnessDispatchKind::Class:
return SGM.Types.getConstantOverrideType(witness);
@@ -3638,11 +3647,21 @@
llvm_unreachable("Unhandled WitnessDispatchKind in switch.");
}
+static std::pair<CanType, ProtocolConformanceRef>
+getSelfTypeAndConformanceForWitness(SILDeclRef witness, SubstitutionMap subs) {
+ auto protocol = cast<ProtocolDecl>(witness.getDecl()->getDeclContext());
+ auto selfParam = protocol->getProtocolSelfType()->getCanonicalType();
+ auto type = subs.getReplacementTypes()[0];
+ auto conf = *subs.lookupConformance(selfParam, protocol);
+ return {type->getCanonicalType(), conf};
+}
+
static SILValue
getWitnessFunctionRef(SILGenFunction &SGF,
SILDeclRef witness,
CanSILFunctionType witnessFTy,
WitnessDispatchKind witnessKind,
+ SubstitutionMap witnessSubs,
SmallVectorImpl<ManagedValue> &witnessParams,
SILLocation loc) {
switch (witnessKind) {
@@ -3650,6 +3669,14 @@
return SGF.emitGlobalFunctionRef(loc, witness);
case WitnessDispatchKind::Dynamic:
return SGF.emitDynamicMethodRef(loc, witness, witnessFTy).getValue();
+ case WitnessDispatchKind::Witness: {
+ auto typeAndConf =
+ getSelfTypeAndConformanceForWitness(witness, witnessSubs);
+ return SGF.B.createWitnessMethod(loc, typeAndConf.first,
+ typeAndConf.second,
+ witness,
+ SILType::getPrimitiveObjectType(witnessFTy));
+ }
case WitnessDispatchKind::Class: {
SILValue selfPtr = witnessParams.back().getValue();
return SGF.emitClassMethodRef(loc, selfPtr, witness, witnessFTy);
@@ -3659,13 +3686,32 @@
llvm_unreachable("Unhandled WitnessDispatchKind in switch.");
}
+static ManagedValue
+emitOpenExistentialInSelfConformance(SILGenFunction &SGF, SILLocation loc,
+ SILDeclRef witness,
+ SubstitutionMap subs, ManagedValue value,
+ SILParameterInfo destParameter) {
+ auto typeAndConf = getSelfTypeAndConformanceForWitness(witness, subs);
+ auto archetype = typeAndConf.first->castTo<ArchetypeType>();
+ assert(archetype->isOpenedExistential());
+
+ auto openedTy = destParameter.getSILStorageType();
+ auto state = SGF.emitOpenExistential(loc, value, archetype, openedTy,
+ destParameter.isIndirectMutating()
+ ? AccessKind::ReadWrite
+ : AccessKind::Read);
+
+ return state.Value;
+}
+
void SILGenFunction::emitProtocolWitness(AbstractionPattern reqtOrigTy,
CanAnyFunctionType reqtSubstTy,
SILDeclRef requirement,
SubstitutionMap reqtSubs,
SILDeclRef witness,
SubstitutionMap witnessSubs,
- IsFreeFunctionWitness_t isFree) {
+ IsFreeFunctionWitness_t isFree,
+ bool isSelfConformance) {
// FIXME: Disable checks that the protocol witness carries debug info.
// Should we carry debug info for witnesses?
F.setBare(IsBare);
@@ -3679,7 +3725,7 @@
FullExpr scope(Cleanups, cleanupLoc);
FormalEvaluationScope formalEvalScope(*this);
- auto witnessKind = getWitnessDispatchKind(witness);
+ auto witnessKind = getWitnessDispatchKind(witness, isSelfConformance);
auto thunkTy = F.getLoweredFunctionType();
SmallVector<ManagedValue, 8> origParams;
@@ -3704,9 +3750,24 @@
->getCanonicalType());
}
+ // Get the lowered type of the witness.
+ auto origWitnessFTy = getWitnessFunctionType(SGM, witness, witnessKind);
+ auto witnessFTy = origWitnessFTy;
+ if (!witnessSubs.empty())
+ witnessFTy = origWitnessFTy->substGenericArgs(SGM.M, witnessSubs);
+
auto reqtSubstParams = reqtSubstTy.getParams();
auto witnessSubstParams = witnessSubstTy.getParams();
+ // For a self-conformance, open the self parameter.
+ if (isSelfConformance) {
+ assert(!isFree && "shouldn't have a free witness for a self-conformance");
+ origParams.back() =
+ emitOpenExistentialInSelfConformance(*this, loc, witness, witnessSubs,
+ origParams.back(),
+ witnessFTy->getSelfParameter());
+ }
+
// For a free function witness, discard the 'self' parameter of the
// requirement.
if (isFree) {
@@ -3716,11 +3777,6 @@
// Translate the argument values from the requirement abstraction level to
// the substituted signature of the witness.
- auto origWitnessFTy = getWitnessFunctionType(SGM, witness, witnessKind);
- auto witnessFTy = origWitnessFTy;
- if (!witnessSubs.empty())
- witnessFTy = origWitnessFTy->substGenericArgs(SGM.M, witnessSubs);
-
SmallVector<ManagedValue, 8> witnessParams;
AbstractionPattern witnessOrigTy(witnessInfo.LoweredType);
TranslateArguments(*this, loc,
@@ -3733,7 +3789,7 @@
SILValue witnessFnRef = getWitnessFunctionRef(*this, witness,
origWitnessFTy,
- witnessKind,
+ witnessKind, witnessSubs,
witnessParams, loc);
auto coroutineKind =
diff --git a/lib/SILGen/SILGenType.cpp b/lib/SILGen/SILGenType.cpp
index 4be10a3..d53c888 100644
--- a/lib/SILGen/SILGenType.cpp
+++ b/lib/SILGen/SILGenType.cpp
@@ -364,6 +364,11 @@
}
};
+static IsSerialized_t isConformanceSerialized(RootProtocolConformance *conf) {
+ return SILWitnessTable::conformanceIsSerialized(conf)
+ ? IsSerialized : IsNotSerialized;
+}
+
/// Emit a witness table for a protocol conformance.
class SILGenConformance : public SILGenWitnessTable<SILGenConformance> {
using super = SILGenWitnessTable<SILGenConformance>;
@@ -380,16 +385,11 @@
// We only need to emit witness tables for base NormalProtocolConformances.
: SGM(SGM), Conformance(C->getRootNormalConformance()),
Linkage(getLinkageForProtocolConformance(Conformance,
- ForDefinition))
+ ForDefinition)),
+ Serialized(isConformanceSerialized(Conformance))
{
auto *proto = Conformance->getProtocol();
- Serialized = IsNotSerialized;
-
- // ... or if the conformance itself thinks it should be.
- if (SILWitnessTable::conformanceIsSerialized(Conformance))
- Serialized = IsSerialized;
-
// Not all protocols use witness tables; in this case we just skip
// all of emit() below completely.
if (!Lowering::TypeConverter::protocolRequiresWitnessTable(proto))
@@ -627,18 +627,13 @@
conformance = *reqtSubMap.lookupConformance(self, requirement);
}
- CanAnyFunctionType reqtSubstTy;
- if (genericEnv) {
- auto *genericSig = genericEnv->getGenericSignature();
- reqtSubstTy = CanGenericFunctionType::get(
- genericSig->getCanonicalSignature(),
- substReqtTy->getParams(), substReqtTy.getResult(),
- reqtOrigTy->getExtInfo());
- } else {
- reqtSubstTy = CanFunctionType::get(substReqtTy->getParams(),
- substReqtTy.getResult(),
- reqtOrigTy->getExtInfo());
- }
+ CanAnyFunctionType reqtSubstTy =
+ CanAnyFunctionType::get(genericEnv ? genericEnv->getGenericSignature()
+ ->getCanonicalSignature()
+ : nullptr,
+ substReqtTy->getParams(),
+ substReqtTy.getResult(),
+ reqtOrigTy->getExtInfo());
// Coroutine lowering requires us to provide these substitutions
// in order to recreate the appropriate yield types for the accessor
@@ -701,13 +696,141 @@
SGF.emitProtocolWitness(AbstractionPattern(reqtOrigTy), reqtSubstTy,
requirement, reqtSubMap, witnessRef,
- witnessSubs, isFree);
+ witnessSubs, isFree, /*isSelfConformance*/ false);
return f;
}
namespace {
+static SILFunction *emitSelfConformanceWitness(SILGenModule &SGM,
+ SelfProtocolConformance *conformance,
+ SILLinkage linkage,
+ SILDeclRef requirement) {
+ auto requirementInfo = SGM.Types.getConstantInfo(requirement);
+
+ // Work out the lowered function type of the SIL witness thunk.
+ auto reqtOrigTy = cast<GenericFunctionType>(requirementInfo.LoweredType);
+
+ // The transformations we do here don't work for generic requirements.
+ GenericEnvironment *genericEnv = nullptr;
+
+ // A mapping from the requirement's generic signature to the type parameters
+ // of the witness thunk (which is non-generic).
+ auto protocol = conformance->getProtocol();
+ auto protocolType = protocol->getDeclaredInterfaceType();
+ auto reqtSubs = SubstitutionMap::getProtocolSubstitutions(protocol,
+ protocolType,
+ ProtocolConformanceRef(protocol));
+
+ // Open the protocol type.
+ auto openedType = ArchetypeType::getOpened(protocolType);
+
+ // Form the substitutions for calling the witness.
+ auto witnessSubs = SubstitutionMap::getProtocolSubstitutions(protocol,
+ openedType,
+ ProtocolConformanceRef(protocol));
+
+ // Substitute to get the formal substituted type of the thunk.
+ auto reqtSubstTy =
+ cast<AnyFunctionType>(reqtOrigTy.subst(reqtSubs)->getCanonicalType());
+
+ // Substitute into the requirement type to get the type of the thunk.
+ auto witnessSILFnType =
+ requirementInfo.SILFnType->substGenericArgs(SGM.M, reqtSubs);
+
+ // Mangle the name of the witness thunk.
+ std::string name = [&] {
+ Mangle::ASTMangler mangler;
+ return mangler.mangleWitnessThunk(conformance, requirement.getDecl());
+ }();
+
+ SILGenFunctionBuilder builder(SGM);
+ auto *f = builder.createFunction(
+ linkage, name, witnessSILFnType, genericEnv,
+ SILLocation(requirement.getDecl()), IsNotBare, IsTransparent,
+ IsSerialized, IsNotDynamic, ProfileCounter(), IsThunk,
+ SubclassScope::NotApplicable, InlineDefault);
+
+ f->setDebugScope(new (SGM.M)
+ SILDebugScope(RegularLocation(requirement.getDecl()), f));
+
+ PrettyStackTraceSILFunction trace("generating protocol witness thunk", f);
+
+ // Create the witness.
+ SILGenFunction SGF(SGM, *f, SGM.SwiftModule);
+
+ auto isFree = isFreeFunctionWitness(requirement.getDecl(),
+ requirement.getDecl());
+
+ SGF.emitProtocolWitness(AbstractionPattern(reqtOrigTy), reqtSubstTy,
+ requirement, reqtSubs, requirement,
+ witnessSubs, isFree, /*isSelfConformance*/ true);
+
+ return f;
+}
+
+/// Emit a witness table for a self-conformance.
+class SILGenSelfConformanceWitnessTable
+ : public SILWitnessVisitor<SILGenSelfConformanceWitnessTable> {
+ using super = SILWitnessVisitor<SILGenSelfConformanceWitnessTable>;
+
+ SILGenModule &SGM;
+ SelfProtocolConformance *conformance;
+ SILLinkage linkage;
+ IsSerialized_t serialized;
+
+ SmallVector<SILWitnessTable::Entry, 8> entries;
+public:
+ SILGenSelfConformanceWitnessTable(SILGenModule &SGM,
+ SelfProtocolConformance *conformance)
+ : SGM(SGM), conformance(conformance),
+ linkage(getLinkageForProtocolConformance(conformance, ForDefinition)),
+ serialized(isConformanceSerialized(conformance)) {
+ }
+
+ void emit() {
+ // Add entries for all the requirements.
+ visitProtocolDecl(conformance->getProtocol());
+
+ // Create the witness table.
+ (void) SILWitnessTable::create(SGM.M, linkage, serialized, conformance,
+ entries, /*conditional*/ {});
+ }
+
+ void addProtocolConformanceDescriptor() {}
+
+ void addOutOfLineBaseProtocol(ProtocolDecl *protocol) {
+ // This is an unnecessary restriction that's just not necessary for Error.
+ llvm_unreachable("base protocols not supported in self-conformance");
+ }
+
+ // These are real semantic restrictions.
+ void addAssociatedConformance(AssociatedConformance conformance) {
+ llvm_unreachable("associated conformances not supported in self-conformance");
+ }
+ void addAssociatedType(AssociatedType type) {
+ llvm_unreachable("associated types not supported in self-conformance");
+ }
+ void addPlaceholder(MissingMemberDecl *placeholder) {
+ llvm_unreachable("placeholders not supported in self-conformance");
+ }
+
+ void addMethod(SILDeclRef requirement) {
+ auto witness = emitSelfConformanceWitness(SGM, conformance, linkage,
+ requirement);
+ entries.push_back(SILWitnessTable::MethodWitness{requirement, witness});
+ }
+};
+}
+
+void SILGenModule::emitSelfConformanceWitnessTable(ProtocolDecl *protocol) {
+ auto conformance = getASTContext().getSelfConformance(protocol);
+ SILGenSelfConformanceWitnessTable(*this, conformance).emit();
+}
+
+namespace {
+
/// Emit a default witness table for a resilient protocol definition.
class SILGenDefaultWitnessTable
: public SILGenWitnessTable<SILGenDefaultWitnessTable> {
@@ -830,6 +953,9 @@
if (!SF || SF->Kind != SourceFileKind::Interface)
SGM.emitDefaultWitnessTable(protocol);
}
+ if (protocol->requiresSelfConformanceWitnessTable()) {
+ SGM.emitSelfConformanceWitnessTable(protocol);
+ }
return;
}
diff --git a/lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp b/lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp
index 51dc183..783ab05 100644
--- a/lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp
+++ b/lib/SILOptimizer/SILCombiner/SILCombinerApplyVisitors.cpp
@@ -623,6 +623,12 @@
SILInstruction *
SILCombiner::propagateSoleConformingType(FullApplySite Apply,
WitnessMethodInst *WMI) {
+ // Disable this optimization for now since it causes miscompiles.
+ //
+ // rdar://46409354
+#if 1
+ return nullptr;
+#else
// If WMI has concrete conformance, it can be optimized.
if (WMI->getConformance().isConcrete())
return nullptr;
@@ -700,6 +706,7 @@
/// Create the new apply instruction using the concrete type.
auto *NewAI = createApplyWithConcreteType(Apply, CEIs, BuilderCtx);
return NewAI;
+#endif
}
/// Given an Apply and an argument value produced by InitExistentialAddrInst,
diff --git a/lib/Sema/CSBindings.cpp b/lib/Sema/CSBindings.cpp
index 75159a9..445e602 100644
--- a/lib/Sema/CSBindings.cpp
+++ b/lib/Sema/CSBindings.cpp
@@ -365,6 +365,7 @@
auto &tc = getTypeChecker();
bool hasNonDependentMemberRelationalConstraints = false;
bool hasDependentMemberRelationalConstraints = false;
+ bool sawNilLiteral = false;
for (auto constraint : constraints) {
switch (constraint->getKind()) {
case ConstraintKind::Bind:
@@ -481,8 +482,10 @@
// If there is a 'nil' literal constraint, we might need optional
// supertype bindings.
if (constraint->getProtocol()->isSpecificProtocol(
- KnownProtocolKind::ExpressibleByNilLiteral))
+ KnownProtocolKind::ExpressibleByNilLiteral)) {
+ sawNilLiteral = true;
addOptionalSupertypeBindings = true;
+ }
// If there is a default literal type for this protocol, it's a
// potential binding.
@@ -721,6 +724,32 @@
result.Bindings.clear();
}
+ // Revise any optional-of-function-types we may try to nil literals
+ // to be non-throwing so they don't inadvertantly result in rethrows
+ // diagnostics.
+ if (sawNilLiteral) {
+ for (auto &binding : result.Bindings) {
+ auto nested = binding.BindingType->lookThroughAllOptionalTypes();
+ if (!nested)
+ continue;
+
+ if (!nested->is<FunctionType>())
+ continue;
+
+ // Remove throws from the nested function type.
+ binding.BindingType =
+ binding.BindingType.transform([&](Type inner) -> Type {
+ auto *fnTy = dyn_cast<FunctionType>(inner.getPointer());
+ if (!fnTy)
+ return inner;
+
+ auto extInfo = fnTy->getExtInfo().withThrows(false);
+ return FunctionType::get(fnTy->getParams(), fnTy->getResult(),
+ extInfo);
+ });
+ }
+ }
+
return result;
}
diff --git a/lib/Sema/CSDiag.cpp b/lib/Sema/CSDiag.cpp
index 5627fd9..656f1c8 100644
--- a/lib/Sema/CSDiag.cpp
+++ b/lib/Sema/CSDiag.cpp
@@ -3056,9 +3056,13 @@
// Look at each of the arguments assigned to this parameter.
auto currentParamType = param.getOldType();
- if (param.isAutoClosure())
- currentParamType =
- currentParamType->castTo<FunctionType>()->getResult();
+ // Since this is diagnostics, let's make sure that parameter
+ // marked as @autoclosure indeed has a function type, because
+ // it can also be an error type and possibly unresolved type.
+ if (param.isAutoClosure()) {
+ if (auto *funcType = currentParamType->getAs<FunctionType>())
+ currentParamType = funcType->getResult();
+ }
for (auto inArgNo : paramBindings[paramIdx]) {
// Determine the argument type.
diff --git a/lib/Sema/CSGen.cpp b/lib/Sema/CSGen.cpp
index 16cf4cd..8e7159d 100644
--- a/lib/Sema/CSGen.cpp
+++ b/lib/Sema/CSGen.cpp
@@ -127,14 +127,20 @@
class LinkedExprCollector : public ASTWalker {
llvm::SmallVectorImpl<Expr*> &LinkedExprs;
+ ConstraintSystem &CS;
public:
-
- LinkedExprCollector(llvm::SmallVectorImpl<Expr*> &linkedExprs) :
- LinkedExprs(linkedExprs) {}
-
+ LinkedExprCollector(llvm::SmallVectorImpl<Expr *> &linkedExprs,
+ ConstraintSystem &cs)
+ : LinkedExprs(linkedExprs), CS(cs) {}
+
std::pair<bool, Expr *> walkToExprPre(Expr *expr) override {
-
+
+ if (CS.shouldReusePrecheckedType() &&
+ !CS.getType(expr)->hasTypeVariable()) {
+ return { false, expr };
+ }
+
// Store top-level binary exprs for further analysis.
if (isa<BinaryExpr>(expr) ||
@@ -195,6 +201,11 @@
LTI(lti), CS(cs) {}
std::pair<bool, Expr *> walkToExprPre(Expr *expr) override {
+
+ if (CS.shouldReusePrecheckedType() &&
+ !CS.getType(expr)->hasTypeVariable()) {
+ return { false, expr };
+ }
if (isa<IntegerLiteralExpr>(expr)) {
LTI.haveIntLiteral = true;
@@ -934,6 +945,11 @@
CS(cs) {}
std::pair<bool, Expr *> walkToExprPre(Expr *expr) override {
+
+ if (CS.shouldReusePrecheckedType() &&
+ !CS.getType(expr)->hasTypeVariable()) {
+ return { false, expr };
+ }
if (auto applyExpr = dyn_cast<ApplyExpr>(expr)) {
if (isa<PrefixUnaryExpr>(applyExpr) ||
@@ -3240,6 +3256,12 @@
std::pair<bool, Expr *> walkToExprPre(Expr *expr) override {
while (true) {
+
+ // If we should reuse pre-checked types, don't sanitize the expression
+ // if it's already type-checked.
+ if (CS.shouldReusePrecheckedType() && expr->getType())
+ return { false, expr };
+
// OpenExistentialExpr contains OpaqueValueExpr in its sub expression.
if (auto OOE = dyn_cast<OpenExistentialExpr>(expr)) {
auto archetypeVal = OOE->getOpaqueValue();
@@ -3409,6 +3431,15 @@
ConstraintWalker(ConstraintGenerator &CG) : CG(CG) { }
std::pair<bool, Expr *> walkToExprPre(Expr *expr) override {
+
+ if (CG.getConstraintSystem().shouldReusePrecheckedType()) {
+ if (expr->getType()) {
+ assert(!expr->getType()->hasTypeVariable());
+ CG.getConstraintSystem().cacheType(expr);
+ return { false, expr };
+ }
+ }
+
// Note that the subexpression of a #selector expression is
// unevaluated.
if (auto sel = dyn_cast<ObjCSelectorExpr>(expr)) {
@@ -3629,7 +3660,7 @@
SmallVector<Expr *, 16> linkedExprs;
// Collect any linked expressions.
- LinkedExprCollector collector(linkedExprs);
+ LinkedExprCollector collector(linkedExprs, *this);
e->walk(collector);
// Favor types, as appropriate.
diff --git a/lib/Sema/CSSimplify.cpp b/lib/Sema/CSSimplify.cpp
index cd6d979..7fe2c67 100644
--- a/lib/Sema/CSSimplify.cpp
+++ b/lib/Sema/CSSimplify.cpp
@@ -1969,21 +1969,23 @@
auto meta1 = cast<AnyMetatypeType>(desugar1);
auto meta2 = cast<AnyMetatypeType>(desugar2);
- ConstraintKind subKind = ConstraintKind::Equal;
// A.Type < B.Type if A < B and both A and B are classes.
- if (isa<MetatypeType>(meta1) &&
- meta1->getInstanceType()->mayHaveSuperclass() &&
- meta2->getInstanceType()->getClassOrBoundGenericClass())
- subKind = std::min(kind, ConstraintKind::Subtype);
// P.Type < Q.Type if P < Q, both P and Q are protocols, and P.Type
- // and Q.Type are both existential metatypes.
- else if (isa<ExistentialMetatypeType>(meta1))
- subKind = std::min(kind, ConstraintKind::Subtype);
-
- return matchTypes(meta1->getInstanceType(), meta2->getInstanceType(),
- subKind, subflags,
- locator.withPathElement(
- ConstraintLocator::InstanceType));
+ // and Q.Type are both existential metatypes
+ auto subKind = std::min(kind, ConstraintKind::Subtype);
+ // If instance types can't have a subtype relationship
+ // it means that such types can be simply equated.
+ auto instanceType1 = meta1->getInstanceType();
+ auto instanceType2 = meta2->getInstanceType();
+ if (isa<MetatypeType>(meta1) &&
+ !(instanceType1->mayHaveSuperclass() &&
+ instanceType2->getClassOrBoundGenericClass())) {
+ subKind = ConstraintKind::Equal;
+ }
+
+ return matchTypes(
+ instanceType1, instanceType2, subKind, subflags,
+ locator.withPathElement(ConstraintLocator::InstanceType));
}
case TypeKind::Function: {
diff --git a/lib/Sema/ConstraintSystem.cpp b/lib/Sema/ConstraintSystem.cpp
index 51a674e..dcfbe28 100644
--- a/lib/Sema/ConstraintSystem.cpp
+++ b/lib/Sema/ConstraintSystem.cpp
@@ -1189,6 +1189,21 @@
OpenedTypeMap *replacementsPtr) {
// Figure out the instance type used for the base.
Type baseObjTy = getFixedTypeRecursive(baseTy, /*wantRValue=*/true);
+
+ ParameterTypeFlags baseFlags;
+ // FIXME(diagnostics): `InOutType` could appear here as a result
+ // of successful re-typecheck of the one of the sub-expressions e.g.
+ // `let _: Int = { (s: inout S) in s.bar() }`. On the first
+ // attempt to type-check whole expression `s.bar()` - is going
+ // to have a base which points directly to declaration of `S`.
+ // But when diagnostics attempts to type-check `s.bar()` standalone
+ // its base would be tranformed into `InOutExpr -> DeclRefExr`,
+ // and `InOutType` is going to be recorded in constraint system.
+ if (auto objType = baseObjTy->getInOutObjectType()) {
+ baseObjTy = objType;
+ baseFlags = baseFlags.withInOut(true);
+ }
+
bool isInstance = true;
if (auto baseMeta = baseObjTy->getAs<AnyMetatypeType>()) {
baseObjTy = baseMeta->getInstanceType();
@@ -1200,7 +1215,7 @@
return getTypeOfReference(value, functionRefKind, locator, useDC, base);
}
- FunctionType::Param baseObjParam(baseObjTy);
+ FunctionType::Param baseObjParam(baseObjTy, Identifier(), baseFlags);
// Don't open existentials when accessing typealias members of
// protocols.
diff --git a/lib/Sema/ConstraintSystem.h b/lib/Sema/ConstraintSystem.h
index 93fd294..1b419a6 100644
--- a/lib/Sema/ConstraintSystem.h
+++ b/lib/Sema/ConstraintSystem.h
@@ -823,6 +823,10 @@
/// system is not applied to the expression AST, but the ConstraintSystem is
/// left in-tact.
AllowUnresolvedTypeVariables = 0x10,
+
+ /// If set, constraint system always reuses type of pre-typechecked
+ /// expression, and doesn't dig into its subexpressions.
+ ReusePrecheckedType = 0x20,
};
/// Options that affect the constraint system as a whole.
@@ -1779,17 +1783,21 @@
public:
/// \brief Whether we should attempt to fix problems.
- bool shouldAttemptFixes() {
+ bool shouldAttemptFixes() const {
if (!(Options & ConstraintSystemFlags::AllowFixes))
return false;
return !solverState || solverState->recordFixes;
}
- bool shouldSuppressDiagnostics() {
+ bool shouldSuppressDiagnostics() const {
return Options.contains(ConstraintSystemFlags::SuppressDiagnostics);
}
+ bool shouldReusePrecheckedType() const {
+ return Options.contains(ConstraintSystemFlags::ReusePrecheckedType);
+ }
+
/// \brief Log and record the application of the fix. Return true iff any
/// subsequent solution would be worse than the best known solution.
bool recordFix(ConstraintFix *fix);
diff --git a/lib/Sema/TypeCheckCaptures.cpp b/lib/Sema/TypeCheckCaptures.cpp
index b05e883..fa82ed3 100644
--- a/lib/Sema/TypeCheckCaptures.cpp
+++ b/lib/Sema/TypeCheckCaptures.cpp
@@ -402,7 +402,9 @@
if (isInOut && !AFR.isKnownNoEscape() && !isNested) {
if (D->getBaseName() == D->getASTContext().Id_self) {
TC.diagnose(DRE->getLoc(),
- diag::closure_implicit_capture_mutating_self);
+ diag::closure_implicit_capture_mutating_self);
+ TC.diagnose(DRE->getLoc(),
+ diag::create_mutating_copy_or_capture_self);
} else {
TC.diagnose(DRE->getLoc(),
diag::closure_implicit_capture_without_noescape);
diff --git a/lib/Sema/TypeCheckConstraints.cpp b/lib/Sema/TypeCheckConstraints.cpp
index 1410e8e..4e7365a 100644
--- a/lib/Sema/TypeCheckConstraints.cpp
+++ b/lib/Sema/TypeCheckConstraints.cpp
@@ -2220,57 +2220,26 @@
}
}
-bool TypeChecker::typeCheckCompletionSequence(Expr *&expr, DeclContext *DC) {
- FrontendStatsTracer StatsTracer(Context.Stats, "typecheck-completion-seq", expr);
+static FunctionType *
+getTypeOfCompletionOperatorImpl(TypeChecker &TC, DeclContext *DC, Expr *expr,
+ ConcreteDeclRef &referencedDecl) {
+ ASTContext &Context = TC.Context;
+
+ FrontendStatsTracer StatsTracer(Context.Stats,
+ "typecheck-completion-operator", expr);
PrettyStackTraceExpr stackTrace(Context, "type-checking", expr);
+ ConstraintSystemOptions options;
+ options |= ConstraintSystemFlags::SuppressDiagnostics;
+ options |= ConstraintSystemFlags::ReusePrecheckedType;
+
// Construct a constraint system from this expression.
- ConstraintSystem CS(*this, DC, ConstraintSystemFlags::SuppressDiagnostics);
+ ConstraintSystem CS(TC, DC, options);
+ expr = CS.generateConstraints(expr);
+ if (!expr)
+ return nullptr;
- auto *SE = cast<SequenceExpr>(expr);
- assert(SE->getNumElements() >= 3);
- auto *op = SE->getElement(SE->getNumElements() - 2);
- auto *CCE = cast<CodeCompletionExpr>(SE->getElements().back());
-
- // Resolve the op.
- op = resolveDeclRefExpr(cast<UnresolvedDeclRefExpr>(op), DC);
- SE->setElement(SE->getNumElements() - 2, op);
-
- // Fold the sequence.
- expr = foldSequence(SE, DC);
-
- // Find the code-completion expression and operator again.
- Expr *exprAsBinOp = nullptr;
- while (true) {
- Expr *RHS;
- if (auto *binExpr = dyn_cast<BinaryExpr>(expr))
- RHS = binExpr->getArg()->getElement(1);
- else if (auto *assignExpr = dyn_cast<AssignExpr>(expr))
- RHS = assignExpr->getSrc();
- else if (auto *ifExpr = dyn_cast<IfExpr>(expr))
- RHS = ifExpr->getElseExpr();
- else
- break;
-
- if (RHS == CCE) {
- exprAsBinOp = expr;
- break;
- }
- expr = RHS;
- }
- if (!exprAsBinOp)
- return true;
-
- // Ensure the output expression is up to date.
- assert(exprAsBinOp == expr && isa<BinaryExpr>(expr) && "found wrong expr?");
-
- if (auto generated = CS.generateConstraints(expr)) {
- expr = generated;
- } else {
- return true;
- }
-
- if (getLangOpts().DebugConstraintSolver) {
+ if (TC.getLangOpts().DebugConstraintSolver) {
auto &log = Context.TypeCheckerDebug->getStream();
log << "---Initial constraints for the given expression---\n";
expr->dump(log);
@@ -2281,20 +2250,100 @@
// Attempt to solve the constraint system.
SmallVector<Solution, 4> viable;
if (CS.solve(expr, viable, FreeTypeVariableBinding::Disallow))
- return true;
+ return nullptr;
auto &solution = viable[0];
- if (getLangOpts().DebugConstraintSolver) {
+ if (TC.getLangOpts().DebugConstraintSolver) {
auto &log = Context.TypeCheckerDebug->getStream();
log << "---Solution---\n";
solution.dump(log);
}
- auto &solutionCS = solution.getConstraintSystem();
- expr->setType(solution.simplifyType(solutionCS.getType(expr)));
- auto completionType = solution.simplifyType(solutionCS.getType(CCE));
- CCE->setType(completionType);
- return false;
+ // Fill the results.
+ Expr *opExpr = cast<ApplyExpr>(expr)->getFn();
+ referencedDecl =
+ solution.resolveLocatorToDecl(CS.getConstraintLocator(opExpr));
+
+ // Return '(ArgType[, ArgType]) -> ResultType' as a function type.
+ // We don't use the type of the operator expression because we want the types
+ // of the *arguments* instead of the types of the parameters.
+ Expr *argsExpr = cast<ApplyExpr>(expr)->getArg();
+ SmallVector<FunctionType::Param, 2> argTypes;
+ if (auto *PE = dyn_cast<ParenExpr>(argsExpr)) {
+ argTypes.emplace_back(solution.simplifyType(CS.getType(PE->getSubExpr())));
+ } else if (auto *TE = dyn_cast<TupleExpr>(argsExpr)) {
+ for (auto arg : TE->getElements())
+ argTypes.emplace_back(solution.simplifyType(CS.getType(arg)));
+ }
+
+ return FunctionType::get(argTypes, solution.simplifyType(CS.getType(expr)));
+}
+
+/// \brief Return the type of operator function for specified LHS, or a null
+/// \c Type on error.
+FunctionType *
+TypeChecker::getTypeOfCompletionOperator(DeclContext *DC, Expr *LHS,
+ Identifier opName, DeclRefKind refKind,
+ ConcreteDeclRef &referencedDecl) {
+
+ // For the infix operator, find the actual LHS from pre-folded LHS.
+ if (refKind == DeclRefKind::BinaryOperator)
+ LHS = findLHS(DC, LHS, opName);
+
+ if (!LHS)
+ return nullptr;
+
+ auto LHSTy = LHS->getType();
+
+ // FIXME: 'UnresolvedType' still might be typechecked by an operator.
+ if (!LHSTy || LHSTy->is<UnresolvedType>())
+ return nullptr;
+
+ // Meta types and function types cannot be a operand of operator expressions.
+ if (LHSTy->is<MetatypeType>() || LHSTy->is<AnyFunctionType>())
+ return nullptr;
+
+ auto Loc = LHS->getEndLoc();
+
+ // Build temporary expression to typecheck.
+ // We allocate these expressions on the stack because we know they can't
+ // escape and there isn't a better way to allocate scratch Expr nodes.
+ UnresolvedDeclRefExpr UDRE(opName, refKind, DeclNameLoc(Loc));
+ auto *opExpr = resolveDeclRefExpr(&UDRE, DC);
+
+ switch (refKind) {
+
+ case DeclRefKind::PostfixOperator: {
+ // (postfix_unary_expr
+ // (declref_expr name=<opName>)
+ // (paren_expr
+ // (<LHS>)))
+ ParenExpr Args(SourceLoc(), LHS, SourceLoc(),
+ /*hasTrailingClosure=*/false);
+ PostfixUnaryExpr postfixExpr(opExpr, &Args);
+ return getTypeOfCompletionOperatorImpl(*this, DC, &postfixExpr,
+ referencedDecl);
+ }
+
+ case DeclRefKind::BinaryOperator: {
+ // (binary_expr
+ // (declref_expr name=<opName>)
+ // (tuple_expr
+ // (<LHS>)
+ // (code_completion_expr)))
+ CodeCompletionExpr dummyRHS(Loc);
+ auto Args = TupleExpr::create(
+ Context, SourceLoc(), {LHS, &dummyRHS}, {}, {}, SourceLoc(),
+ /*hasTrailingClosure=*/false, /*isImplicit=*/true);
+ BinaryExpr binaryExpr(opExpr, Args, /*isImplicit=*/true);
+
+ return getTypeOfCompletionOperatorImpl(*this, DC, &binaryExpr,
+ referencedDecl);
+ }
+
+ default:
+ llvm_unreachable("Invalid DeclRefKind for operator completion");
+ }
}
bool TypeChecker::typeCheckBinding(Pattern *&pattern, Expr *&initializer,
diff --git a/lib/Sema/TypeCheckError.cpp b/lib/Sema/TypeCheckError.cpp
index 7d885c5..3ee3982 100644
--- a/lib/Sema/TypeCheckError.cpp
+++ b/lib/Sema/TypeCheckError.cpp
@@ -146,6 +146,9 @@
// Look through closure capture lists.
} else if (auto captureList = dyn_cast<CaptureListExpr>(fn)) {
fn = captureList->getClosureBody();
+ // Look through optional evaluations.
+ } else if (auto optionalEval = dyn_cast<OptionalEvaluationExpr>(fn)) {
+ fn = optionalEval->getSubExpr()->getValueProvidingExpr();
} else {
break;
}
@@ -710,7 +713,10 @@
// If it doesn't have function type, we must have invalid code.
Type argType = fn.getType();
- auto argFnType = (argType ? argType->getAs<AnyFunctionType>() : nullptr);
+ if (!argType) return Classification::forInvalidCode();
+
+ auto argFnType =
+ argType->lookThroughAllOptionalTypes()->getAs<AnyFunctionType>();
if (!argFnType) return Classification::forInvalidCode();
// If it doesn't throw, this argument does not cause the call to throw.
diff --git a/lib/Sema/TypeCheckExpr.cpp b/lib/Sema/TypeCheckExpr.cpp
index 15786b8..33e86e1 100644
--- a/lib/Sema/TypeCheckExpr.cpp
+++ b/lib/Sema/TypeCheckExpr.cpp
@@ -190,6 +190,15 @@
return lookupPrecedenceGroupForInfixOperator(DC, binaryExpr->getFn());
}
+ if (auto *DSCE = dyn_cast<DotSyntaxCallExpr>(E)) {
+ return lookupPrecedenceGroupForInfixOperator(DC, DSCE->getFn());
+ }
+
+ if (auto *MRE = dyn_cast<MemberRefExpr>(E)) {
+ Identifier name = MRE->getDecl().getDecl()->getBaseName().getIdentifier();
+ return lookupPrecedenceGroupForOperator(*this, DC, name, MRE->getLoc());
+ }
+
// If E is already an ErrorExpr, then we've diagnosed it as invalid already,
// otherwise emit an error.
if (!isa<ErrorExpr>(E))
@@ -198,6 +207,58 @@
return nullptr;
}
+/// Find LHS as if we append binary operator to existing pre-folded expresion.
+/// Returns found expression, or \c nullptr if the operator is not applicable.
+///
+/// For example, given '(== R (* A B))':
+/// 'findLHS(DC, expr, "+")' returns '(* A B)'.
+/// 'findLHS(DC, expr, "<<")' returns 'B'.
+/// 'findLHS(DC, expr, '==')' returns nullptr.
+Expr *TypeChecker::findLHS(DeclContext *DC, Expr *E, Identifier name) {
+ auto right = lookupPrecedenceGroupForOperator(*this, DC, name, E->getEndLoc());
+ while (true) {
+
+ // Look through implicit conversions.
+ if (auto ICE = dyn_cast<ImplicitConversionExpr>(E)) {
+ E = ICE->getSyntacticSubExpr();
+ continue;
+ }
+ if (auto ACE = dyn_cast<AutoClosureExpr>(E)) {
+ E = ACE->getSingleExpressionBody();
+ continue;
+ }
+
+ auto left = lookupPrecedenceGroupForInfixOperator(DC, E);
+ if (!left)
+ // LHS is not binary expression.
+ return E;
+ switch (Context.associateInfixOperators(left, right)) {
+ case swift::Associativity::None:
+ return nullptr;
+ case swift::Associativity::Left:
+ return E;
+ case swift::Associativity::Right:
+ break;
+ }
+ // Find the RHS of the current binary expr.
+ if (auto *assignExpr = dyn_cast<AssignExpr>(E)) {
+ E = assignExpr->getSrc();
+ } else if (auto *ifExpr = dyn_cast<IfExpr>(E)) {
+ E = ifExpr->getElseExpr();
+ } else if (auto *binaryExpr = dyn_cast<BinaryExpr>(E)) {
+ auto *Args = dyn_cast<TupleExpr>(binaryExpr->getArg());
+ if (!Args || Args->getNumElements() != 2)
+ return nullptr;
+ E = Args->getElement(1);
+ } else {
+ // E.g. 'fn() as Int << 2'.
+ // In this case '<<' has higher precedence than 'as', but the LHS should
+ // be 'fn() as Int' instead of 'Int'.
+ return E;
+ }
+ }
+}
+
// The way we compute isEndOfSequence relies on the assumption that
// the sequence-folding algorithm never recurses with a prefix of the
// entire sequence.
diff --git a/lib/Sema/TypeCheckNameLookup.cpp b/lib/Sema/TypeCheckNameLookup.cpp
index c526965..f4161b7 100644
--- a/lib/Sema/TypeCheckNameLookup.cpp
+++ b/lib/Sema/TypeCheckNameLookup.cpp
@@ -637,15 +637,6 @@
return true;
}
-static bool isLocInVarInit(TypeChecker &TC, VarDecl *var, SourceLoc loc) {
- auto binding = var->getParentPatternBinding();
- if (!binding || binding->isImplicit())
- return false;
-
- auto initRange = binding->getSourceRange();
- return TC.Context.SourceMgr.rangeContainsTokenLoc(initRange, loc);
-}
-
void TypeChecker::performTypoCorrection(DeclContext *DC, DeclRefKind refKind,
Type baseTypeOrNull,
NameLookupOptions lookupOptions,
@@ -670,12 +661,6 @@
if (!isPlausibleTypo(refKind, corrections.WrittenName, decl))
return;
- // Don't suggest a variable within its own initializer.
- if (auto var = dyn_cast<VarDecl>(decl)) {
- if (isLocInVarInit(*this, var, corrections.Loc.getBaseNameLoc()))
- return;
- }
-
auto candidateName = decl->getFullName();
// Don't waste time computing edit distances that are more than
diff --git a/lib/Sema/TypeCheckProtocol.cpp b/lib/Sema/TypeCheckProtocol.cpp
index cc4301e..3a34ed6 100644
--- a/lib/Sema/TypeCheckProtocol.cpp
+++ b/lib/Sema/TypeCheckProtocol.cpp
@@ -23,6 +23,7 @@
#include "swift/Basic/StringExtras.h"
#include "swift/Basic/Statistic.h"
#include "swift/AST/AccessScope.h"
+#include "swift/AST/AccessScopeChecker.h"
#include "swift/AST/GenericSignatureBuilder.h"
#include "swift/AST/ASTContext.h"
#include "swift/AST/ASTMangler.h"
@@ -2474,11 +2475,46 @@
// Inject the typealias into the nominal decl that conforms to the protocol.
if (auto nominal = DC->getSelfNominalTypeDecl()) {
- // FIXME: Ideally this would use the protocol's access too---that is,
- // a typealias added for an internal protocol shouldn't need to be
- // public---but that can be problematic if the same type conforms to two
- // protocols with different access levels.
- aliasDecl->copyFormalAccessFrom(nominal, /*sourceIsParentContext*/true);
+ AccessScope requiredAccessScope = getRequiredAccessScope();
+
+ if (!TC.Context.isSwiftVersionAtLeast(5) &&
+ DC->getParentModule()->getResilienceStrategy() !=
+ ResilienceStrategy::Resilient) {
+ // HACK: In pre-Swift-5, these typealiases were synthesized with the
+ // same access level as the conforming type, which might be more
+ // visible than the associated type witness. Preserve that behavior
+ // when the underlying type has sufficient access, but only in
+ // non-resilient modules.
+ Optional<AccessScope> underlyingTypeScope =
+ TypeAccessScopeChecker::getAccessScope(type, DC,
+ /*usableFromInline*/false);
+ assert(underlyingTypeScope.hasValue() &&
+ "the type is already invalid and we shouldn't have gotten here");
+
+ AccessScope nominalAccessScope = nominal->getFormalAccessScope(DC);
+ Optional<AccessScope> widestPossibleScope =
+ underlyingTypeScope->intersectWith(nominalAccessScope);
+ assert(widestPossibleScope.hasValue() &&
+ "we found the nominal and the type witness, didn't we?");
+ requiredAccessScope = widestPossibleScope.getValue();
+ }
+
+ // An associated type witness can never be less than fileprivate, since
+ // it must always be at least as visible as the enclosing type.
+ AccessLevel requiredAccess =
+ std::max(requiredAccessScope.accessLevelForDiagnostics(),
+ AccessLevel::FilePrivate);
+
+ aliasDecl->setAccess(requiredAccess);
+ if (isUsableFromInlineRequired()) {
+ auto *attr = new (TC.Context) UsableFromInlineAttr(/*implicit=*/true);
+ aliasDecl->getAttrs().add(attr);
+ }
+
+ bool unused;
+ assert(TC.Context.hadError() ||
+ !checkWitnessAccess(assocType, aliasDecl, &unused));
+ (void)unused;
if (nominal == DC) {
nominal->addMember(aliasDecl);
diff --git a/lib/Sema/TypeChecker.cpp b/lib/Sema/TypeChecker.cpp
index 504766f..5cbc12e 100644
--- a/lib/Sema/TypeChecker.cpp
+++ b/lib/Sema/TypeChecker.cpp
@@ -304,15 +304,18 @@
/// context have been configured.
static void configureOuterGenericParams(const GenericContext *dc) {
auto genericParams = dc->getGenericParams();
- if (!genericParams) return;
- if (genericParams->getOuterParameters()) return;
+ // If we already configured the outer parameters, we're done.
+ if (genericParams && genericParams->getOuterParameters())
+ return;
DeclContext *outerDC = dc->getParent();
while (!outerDC->isModuleScopeContext()) {
if (auto outerDecl = outerDC->getAsDecl()) {
if (auto outerGenericDC = outerDecl->getAsGenericContext()) {
- genericParams->setOuterParameters(outerGenericDC->getGenericParams());
+ if (genericParams)
+ genericParams->setOuterParameters(outerGenericDC->getGenericParams());
+
configureOuterGenericParams(outerGenericDC);
return;
}
@@ -840,11 +843,17 @@
referencedDecl);
}
-bool swift::typeCheckCompletionSequence(DeclContext *DC, Expr *&parsedExpr) {
+/// \brief Return the type of operator function for specified LHS, or a null
+/// \c Type on error.
+FunctionType *
+swift::getTypeOfCompletionOperator(DeclContext *DC, Expr *LHS,
+ Identifier opName, DeclRefKind refKind,
+ ConcreteDeclRef &referencedDecl) {
auto &ctx = DC->getASTContext();
DiagnosticSuppression suppression(ctx.Diags);
TypeChecker &TC = createTypeChecker(ctx);
- return TC.typeCheckCompletionSequence(parsedExpr, DC);
+ return TC.getTypeOfCompletionOperator(DC, LHS, opName, refKind,
+ referencedDecl);
}
bool swift::typeCheckExpression(DeclContext *DC, Expr *&parsedExpr) {
diff --git a/lib/Sema/TypeChecker.h b/lib/Sema/TypeChecker.h
index ff6f076..8ee715b 100644
--- a/lib/Sema/TypeChecker.h
+++ b/lib/Sema/TypeChecker.h
@@ -1404,7 +1404,12 @@
FreeTypeVariableBinding::Disallow,
ExprTypeCheckListener *listener = nullptr);
- bool typeCheckCompletionSequence(Expr *&expr, DeclContext *DC);
+ /// \brief Return the type of operator function for specified LHS, or a null
+ /// \c Type on error.
+ FunctionType *getTypeOfCompletionOperator(DeclContext *DC, Expr *LHS,
+ Identifier opName,
+ DeclRefKind refKind,
+ ConcreteDeclRef &referencedDecl);
/// Check the key-path expression.
///
@@ -1885,6 +1890,10 @@
PrecedenceGroupDecl *lookupPrecedenceGroup(DeclContext *dc, Identifier name,
SourceLoc nameLoc);
+ /// Given an pre-folded expression, find LHS from the expression if a binary
+ /// operator \c name appended to the expression.
+ Expr *findLHS(DeclContext *DC, Expr *E, Identifier name);
+
/// \brief Look up the Bool type in the standard library.
Type lookupBoolType(const DeclContext *dc);
diff --git a/lib/Serialization/SerializedModuleLoader.cpp b/lib/Serialization/SerializedModuleLoader.cpp
index cfc2543..c0d3579 100644
--- a/lib/Serialization/SerializedModuleLoader.cpp
+++ b/lib/Serialization/SerializedModuleLoader.cpp
@@ -128,6 +128,23 @@
archName, foundArchs);
}
+static std::pair<llvm::SmallString<16>, llvm::SmallString<16>>
+getArchSpecificModuleFileNames(StringRef archName) {
+ llvm::SmallString<16> archFile, archDocFile;
+
+ if (!archName.empty()) {
+ archFile += archName;
+ archFile += '.';
+ archFile += file_types::getExtension(file_types::TY_SwiftModuleFile);
+
+ archDocFile += archName;
+ archDocFile += '.';
+ archDocFile += file_types::getExtension(file_types::TY_SwiftModuleDocFile);
+ }
+
+ return {archFile, archDocFile};
+}
+
bool
SerializedModuleLoaderBase::findModule(AccessPathElem moduleID,
std::unique_ptr<llvm::MemoryBuffer> *moduleBuffer,
@@ -143,19 +160,19 @@
moduleDocFilename +=
file_types::getExtension(file_types::TY_SwiftModuleDocFile);
- // FIXME: Which name should we be using here? Do we care about CPU subtypes?
- // FIXME: At the very least, don't hardcode "arch".
- llvm::SmallString<16> archName{
- Ctx.LangOpts.getPlatformConditionValue(PlatformConditionKind::Arch)};
- llvm::SmallString<16> archFile{archName};
- llvm::SmallString<16> archDocFile{archName};
- if (!archFile.empty()) {
- archFile += '.';
- archFile += file_types::getExtension(file_types::TY_SwiftModuleFile);
+ StringRef archName = Ctx.LangOpts.Target.getArchName();
+ auto archFileNames = getArchSpecificModuleFileNames(archName);
- archDocFile += '.';
- archDocFile += file_types::getExtension(file_types::TY_SwiftModuleDocFile);
- }
+ // FIXME: We used to use "major architecture" names for these files---the
+ // names checked in "#if arch(...)". Fall back to that name in the one case
+ // where it's different from what Swift 4.2 supported: 32-bit ARM platforms.
+ // We should be able to drop this once there's an Xcode that supports the
+ // new names.
+ StringRef alternateArchName;
+ if (Ctx.LangOpts.Target.getArch() == llvm::Triple::ArchType::arm)
+ alternateArchName = "arm";
+ auto alternateArchFileNames =
+ getArchSpecificModuleFileNames(alternateArchName);
llvm::SmallString<128> scratch;
llvm::SmallString<128> currPath;
@@ -169,10 +186,19 @@
currPath = path;
llvm::sys::path::append(currPath, moduleFilename.str());
err = openModuleFiles(currPath,
- archFile.str(), archDocFile.str(),
+ archFileNames.first, archFileNames.second,
moduleBuffer, moduleDocBuffer,
scratch);
+ if (err == std::errc::no_such_file_or_directory &&
+ !alternateArchName.empty()) {
+ err = openModuleFiles(currPath,
+ alternateArchFileNames.first,
+ alternateArchFileNames.second,
+ moduleBuffer, moduleDocBuffer,
+ scratch);
+ }
+
if (err == std::errc::no_such_file_or_directory) {
addDiagnosticInfoForArchitectureMismatch(
Ctx, moduleID.second, moduleName, archName, currPath);
@@ -197,9 +223,18 @@
}
llvm::sys::path::append(currPath, "Modules", moduleFilename.str());
- auto err = openModuleFiles(currPath, archFile.str(), archDocFile.str(),
+ auto err = openModuleFiles(currPath,
+ archFileNames.first, archFileNames.second,
moduleBuffer, moduleDocBuffer, scratch);
+ if (err == std::errc::no_such_file_or_directory &&
+ !alternateArchName.empty()) {
+ err = openModuleFiles(currPath,
+ alternateArchFileNames.first,
+ alternateArchFileNames.second,
+ moduleBuffer, moduleDocBuffer, scratch);
+ }
+
if (err == std::errc::no_such_file_or_directory) {
addDiagnosticInfoForArchitectureMismatch(
Ctx, moduleID.second, moduleName, archName, currPath);
diff --git a/stdlib/public/SwiftShims/System.h b/stdlib/public/SwiftShims/System.h
index a8fae1f..e7d4df2 100644
--- a/stdlib/public/SwiftShims/System.h
+++ b/stdlib/public/SwiftShims/System.h
@@ -136,9 +136,10 @@
/// Darwin reserves the low 4GB of address space.
#define SWIFT_ABI_DARWIN_ARM64_LEAST_VALID_POINTER 0x100000000ULL
-// TBI guarantees the top byte of pointers is unused.
+// TBI guarantees the top byte of pointers is unused, but ARMv8.5-A
+// claims the bottom four bits of that for memory tagging.
// Heap objects are eight-byte aligned.
-#define SWIFT_ABI_ARM64_SWIFT_SPARE_BITS_MASK 0xFF00000000000007ULL
+#define SWIFT_ABI_ARM64_SWIFT_SPARE_BITS_MASK 0xF000000000000007ULL
// Objective-C reserves just the high bit for tagged pointers.
#define SWIFT_ABI_ARM64_OBJC_RESERVED_BITS_MASK 0x8000000000000000ULL
diff --git a/stdlib/public/core/ArrayBufferProtocol.swift b/stdlib/public/core/ArrayBufferProtocol.swift
index 63f1559..ecebbc8 100644
--- a/stdlib/public/core/ArrayBufferProtocol.swift
+++ b/stdlib/public/core/ArrayBufferProtocol.swift
@@ -128,7 +128,8 @@
// Make sure the compiler does not inline _copyBuffer to reduce code size.
@inline(never)
- @usableFromInline
+ @inlinable // This code should be specializable such that copying an array is
+ // fast and does not end up in an unspecialized entry point.
internal init(copying buffer: Self) {
let newBuffer = _ContiguousArrayBuffer<Element>(
_uninitializedCount: buffer.count, minimumCapacity: buffer.count)
diff --git a/stdlib/public/core/Integers.swift b/stdlib/public/core/Integers.swift
index bdf94aa..fdaeeb1 100644
--- a/stdlib/public/core/Integers.swift
+++ b/stdlib/public/core/Integers.swift
@@ -318,17 +318,6 @@
}
}
-
-/// Returns the absolute value of the given number.
-///
-/// - Parameter x: A signed number.
-/// - Returns: The absolute value of `x`.
-@inlinable
-public func abs<T : SignedNumeric>(_ x: T) -> T
- where T.Magnitude == T {
- return x.magnitude
-}
-
/// Returns the absolute value of the given number.
///
/// The absolute value of `x` must be representable in the same type. In
@@ -344,6 +333,10 @@
/// - Returns: The absolute value of `x`.
@inlinable
public func abs<T : SignedNumeric & Comparable>(_ x: T) -> T {
+ if T.self == T.Magnitude.self {
+ return unsafeBitCast(x.magnitude, to: T.self)
+ }
+
return x < (0 as T) ? -x : x
}
diff --git a/stdlib/public/core/KeyPath.swift b/stdlib/public/core/KeyPath.swift
index 91ad1b7..9c499d8 100644
--- a/stdlib/public/core/KeyPath.swift
+++ b/stdlib/public/core/KeyPath.swift
@@ -2099,7 +2099,7 @@
rootKVCLength = Int(_swift_stdlib_strlen(rootPtr))
leafKVCLength = Int(_swift_stdlib_strlen(leafPtr))
// root + "." + leaf
- appendedKVCLength = rootKVCLength + 1 + leafKVCLength
+ appendedKVCLength = rootKVCLength + 1 + leafKVCLength + 1
} else {
rootKVCLength = 0
leafKVCLength = 0
diff --git a/stdlib/public/core/NormalizedCodeUnitIterator.swift b/stdlib/public/core/NormalizedCodeUnitIterator.swift
index 830c2f9..77a5277 100644
--- a/stdlib/public/core/NormalizedCodeUnitIterator.swift
+++ b/stdlib/public/core/NormalizedCodeUnitIterator.swift
@@ -16,58 +16,6 @@
internal typealias _SegmentOutputBuffer = _FixedArray16<UInt16>
}
-extension Unicode.Scalar {
- // Normalization boundary - a place in a string where everything left of the
- // boundary can be normalized independently from everything right of the
- // boundary. The concatenation of each result is the same as if the entire
- // string had been normalized as a whole.
- //
- // Normalization segment - a sequence of code units between two normalization
- // boundaries (without any boundaries in the middle). Note that normalization
- // segments can, as a process of normalization, expand, contract, and even
- // produce new sub-segments.
-
- // Whether this scalar value always has a normalization boundary before it.
- internal var _hasNormalizationBoundaryBefore: Bool {
- _internalInvariant(Int32(exactly: self.value) != nil, "top bit shouldn't be set")
- let value = Int32(bitPattern: self.value)
- return 0 != __swift_stdlib_unorm2_hasBoundaryBefore(
- _Normalization._nfcNormalizer, value)
- }
- internal var _isNFCQCYes: Bool {
- return __swift_stdlib_u_getIntPropertyValue(
- Builtin.reinterpretCast(value), __swift_stdlib_UCHAR_NFC_QUICK_CHECK
- ) == 1
- }
-}
-
-internal func _tryNormalize(
- _ input: UnsafeBufferPointer<UInt16>,
- into outputBuffer:
- UnsafeMutablePointer<_Normalization._SegmentOutputBuffer>
-) -> Int? {
- return _tryNormalize(input, into: _castOutputBuffer(outputBuffer))
-}
-internal func _tryNormalize(
- _ input: UnsafeBufferPointer<UInt16>,
- into outputBuffer: UnsafeMutableBufferPointer<UInt16>
-) -> Int? {
- var err = __swift_stdlib_U_ZERO_ERROR
- let count = __swift_stdlib_unorm2_normalize(
- _Normalization._nfcNormalizer,
- input.baseAddress._unsafelyUnwrappedUnchecked,
- numericCast(input.count),
- outputBuffer.baseAddress._unsafelyUnwrappedUnchecked,
- numericCast(outputBuffer.count),
- &err
- )
- guard err.isSuccess else {
- // The output buffer needs to grow
- return nil
- }
- return numericCast(count)
-}
-
//
// Pointer casting helpers
//
@@ -131,9 +79,11 @@
if index == 0 || index == count {
return true
}
-
assert(!_isContinuation(self[_unchecked: index]))
+ // Sub-300 latiny fast-path
+ if self[_unchecked: index] < 0xCC { return true }
+
let cu = _decodeScalar(self, startingAt: index).0
return cu._hasNormalizationBoundaryBefore
}
@@ -191,34 +141,6 @@
return utf8Buffer[bufferIndex]
}
-
- internal mutating func compare(
- with other: _NormalizedUTF8CodeUnitIterator
- ) -> _StringComparisonResult {
- var mutableOther = other
-
- for cu in self {
- if let otherCU = mutableOther.next() {
- let result = _lexicographicalCompare(cu, otherCU)
- if result == .equal {
- continue
- } else {
- return result
- }
- } else {
- //other returned nil, we are greater
- return .greater
- }
- }
-
- //we ran out of code units, either we are equal, or only we ran out and
- //other is greater
- if let _ = mutableOther.next() {
- return .less
- } else {
- return .equal
- }
- }
}
extension _NormalizedUTF8CodeUnitIterator: Sequence { }
@@ -513,16 +435,6 @@
@inline(__always)
@_effects(releasenone)
private mutating func fastPathFill() -> (numRead: Int, numWritten: Int) {
- // Quick check if a scalar is NFC and a segment starter
- @inline(__always) func isNFCStarter(_ scalar: Unicode.Scalar) -> Bool {
- // Fast-path: All scalars up through U+02FF are NFC and have boundaries
- // before them
- if scalar.value < 0x300 { return true }
-
- // Otherwise, consult the properties
- return scalar._hasNormalizationBoundaryBefore && scalar._isNFCQCYes
- }
-
// TODO: Additional fast-path: All CCC-ascending NFC_QC segments are NFC
// TODO: Just freakin do normalization and don't bother with ICU
var outputCount = 0
@@ -540,7 +452,7 @@
if _slowPath(
!utf8.hasNormalizationBoundary(before: inputCount &+ len)
- || !isNFCStarter(scalar)
+ || !scalar._isNFCStarter
) {
break
}
@@ -566,7 +478,7 @@
if _slowPath(
!gutsSlice.foreignHasNormalizationBoundary(
before: startIdx.encoded(offsetBy: len))
- || !isNFCStarter(scalar)
+ || !scalar._isNFCStarter
) {
break
}
@@ -627,29 +539,22 @@
@_effects(readonly)
internal mutating func compare(
- with other: _NormalizedUTF8CodeUnitIterator_2
- ) -> _StringComparisonResult {
- var iter = self
+ with other: _NormalizedUTF8CodeUnitIterator_2,
+ expecting: _StringComparisonResult
+ ) -> Bool {
var mutableOther = other
- while let cu = iter.next() {
- if let otherCU = mutableOther.next() {
- let result = _lexicographicalCompare(cu, otherCU)
- if result == .equal {
- continue
- }
- return result
+ for cu in self {
+ guard let otherCU = mutableOther.next() else {
+ // We have more code units, therefore we are greater
+ return false
}
- //other returned nil, we are greater
- return .greater
+ if cu == otherCU { continue }
+ return expecting == .less ? cu < otherCU : false
}
- //we ran out of code units, either we are equal, or only we ran out and
- //other is greater
- if let _ = mutableOther.next() {
- return .less
- }
- return .equal
+ // We have exhausted our code units. We are less if there's more remaining
+ return mutableOther.next() == nil ? expecting == .equal : expecting == .less
}
}
diff --git a/stdlib/public/core/StringComparison.swift b/stdlib/public/core/StringComparison.swift
index 65718d1..684bf90 100644
--- a/stdlib/public/core/StringComparison.swift
+++ b/stdlib/public/core/StringComparison.swift
@@ -12,151 +12,246 @@
import SwiftShims
-
-@usableFromInline
+@inlinable @inline(__always) // top-level fastest-paths
@_effects(readonly)
internal func _stringCompare(
- _ lhs: _StringGuts, _ rhs: _StringGuts,
- expecting: _StringComparisonResult
+ _ lhs: _StringGuts, _ rhs: _StringGuts, expecting: _StringComparisonResult
) -> Bool {
- _internalInvariant(expecting == .equal || expecting == .less)
- if lhs.rawBits == rhs.rawBits {
- return expecting == .equal
- }
- if _fastPath(lhs.isFastUTF8 && rhs.isFastUTF8) {
- let isNFC = lhs.isNFC && rhs.isNFC
- return lhs.withFastUTF8 { utf8Left in
- return rhs.withFastUTF8 { utf8Right in
- if isNFC {
- let cmp = _binaryCompare(utf8Left, utf8Right)
- if expecting == .equal {
- return cmp == 0
- }
- _internalInvariant(expecting == .less)
- return cmp < 0
- }
-
- return _stringCompare(utf8Left, utf8Right, expecting: expecting)
- }
- }
- }
- return _stringCompareSlow(
- lhs, 0..<lhs.count, rhs, 0..<rhs.count, expecting: expecting)
+ if lhs.rawBits == rhs.rawBits { return expecting == .equal }
+ return _stringCompareInternal(lhs, rhs, expecting: expecting)
}
@usableFromInline
@_effects(readonly)
+internal func _stringCompareInternal(
+ _ lhs: _StringGuts, _ rhs: _StringGuts, expecting: _StringComparisonResult
+) -> Bool {
+ guard _fastPath(lhs.isFastUTF8 && rhs.isFastUTF8) else {
+ return _stringCompareSlow(lhs, rhs, expecting: expecting)
+ }
+
+ let isNFC = lhs.isNFC && rhs.isNFC
+ return lhs.withFastUTF8 { lhsUTF8 in
+ return rhs.withFastUTF8 { rhsUTF8 in
+ return _stringCompareFastUTF8(
+ lhsUTF8, rhsUTF8, expecting: expecting, bothNFC: isNFC)
+ }
+ }
+}
+
+@inlinable @inline(__always) // top-level fastest-paths
+@_effects(readonly)
internal func _stringCompare(
_ lhs: _StringGuts, _ lhsRange: Range<Int>,
_ rhs: _StringGuts, _ rhsRange: Range<Int>,
expecting: _StringComparisonResult
) -> Bool {
- _internalInvariant(expecting == .equal || expecting == .less)
if lhs.rawBits == rhs.rawBits && lhsRange == rhsRange {
return expecting == .equal
}
- if _fastPath(lhs.isFastUTF8 && rhs.isFastUTF8) {
- let isNFC = lhs.isNFC && rhs.isNFC
- return lhs.withFastUTF8(range: lhsRange) { utf8Left in
- return rhs.withFastUTF8(range: rhsRange) { utf8Right in
- if isNFC {
- let cmp = _binaryCompare(utf8Left, utf8Right)
- if expecting == .equal {
- return cmp == 0
- }
- _internalInvariant(expecting == .less)
- return cmp < 0
- }
+ return _stringCompareInternal(
+ lhs, lhsRange, rhs, rhsRange, expecting: expecting)
+}
- return _stringCompare(utf8Left, utf8Right, expecting: expecting)
- }
+@usableFromInline
+@_effects(readonly)
+internal func _stringCompareInternal(
+ _ lhs: _StringGuts, _ lhsRange: Range<Int>,
+ _ rhs: _StringGuts, _ rhsRange: Range<Int>,
+ expecting: _StringComparisonResult
+) -> Bool {
+ guard _fastPath(lhs.isFastUTF8 && rhs.isFastUTF8) else {
+ return _stringCompareSlow(
+ lhs, lhsRange, rhs, rhsRange, expecting: expecting)
+ }
+
+ let isNFC = lhs.isNFC && rhs.isNFC
+ return lhs.withFastUTF8(range: lhsRange) { lhsUTF8 in
+ return rhs.withFastUTF8(range: rhsRange) { rhsUTF8 in
+ return _stringCompareFastUTF8(
+ lhsUTF8, rhsUTF8, expecting: expecting, bothNFC: isNFC)
}
}
- return _stringCompareSlow(lhs, lhsRange, rhs, rhsRange, expecting: expecting)
}
-@usableFromInline
@_effects(readonly)
-internal func _stringCompareSlow(
- _ lhs: _StringGuts, _ lhsRange: Range<Int>?,
- _ rhs: _StringGuts, _ rhsRange: Range<Int>?,
- expecting: _StringComparisonResult
+private func _stringCompareFastUTF8(
+ _ utf8Left: UnsafeBufferPointer<UInt8>,
+ _ utf8Right: UnsafeBufferPointer<UInt8>,
+ expecting: _StringComparisonResult,
+ bothNFC: Bool
) -> Bool {
- return _StringGutsSlice(lhs, lhsRange ?? 0..<lhs.count).compare(
- with: _StringGutsSlice(rhs, rhsRange ?? 0..<rhs.count),
- expecting: expecting)
+ if _fastPath(bothNFC) {
+ let cmp = _binaryCompare(utf8Left, utf8Right)
+ return _lexicographicalCompare(cmp, 0, expecting: expecting)
+ }
+
+ return _stringCompareFastUTF8Abnormal(
+ utf8Left, utf8Right, expecting: expecting)
}
-@usableFromInline
@_effects(readonly)
-internal func _stringCompare(
- _ left: UnsafeBufferPointer<UInt8>,
- _ right: UnsafeBufferPointer<UInt8>,
+private func _stringCompareFastUTF8Abnormal(
+ _ utf8Left: UnsafeBufferPointer<UInt8>,
+ _ utf8Right: UnsafeBufferPointer<UInt8>,
expecting: _StringComparisonResult
) -> Bool {
- _internalInvariant(expecting == .equal || expecting == .less)
-
- if _binaryCompare(left, right) == 0 {
- return expecting == .equal
- }
-
- // Do a binary scan finding the point of divergence. From there, see if we can
- // determine our answer right away, otherwise back up to the beginning of the
- // current normalization segment and fall back to the slow path.
- var idx = 0
- let end = Swift.min(left.count, right.count)
- let leftPtr = left.baseAddress._unsafelyUnwrappedUnchecked
- let rightPtr = right.baseAddress._unsafelyUnwrappedUnchecked
- while idx < end {
- guard leftPtr[idx] == rightPtr[idx] else { break }
- idx &+= 1
- }
- _internalInvariant(idx != left.count || idx != right.count,
- "should of been cought by prior binary compare")
- if idx == end {
+ // Do a binary-equality prefix scan, to skip over long common prefixes.
+ guard let diffIdx = _findDiffIdx(utf8Left, utf8Right) else {
// We finished one of our inputs.
//
// TODO: This gives us a consistent and good ordering, but technically it
// could differ from our stated ordering if combination with a prior scalar
// did not produce a greater-value scalar. Consider checking normality.
- return expecting == _lexicographicalCompare(left.count, right.count)
+ return _lexicographicalCompare(
+ utf8Left.count, utf8Right.count, expecting: expecting)
}
- // Back up to nearest scalar boundary and check if normal and end of segment.
- // If so, we have our answer.
- while _isContinuation(left[_unchecked: idx]) && idx > 0 { idx &-= 1 }
+ let scalarDiffIdx = _scalarAlign(utf8Left, diffIdx)
+ _internalInvariant(scalarDiffIdx == _scalarAlign(utf8Right, diffIdx))
- // TODO: Refactor this into a function, handle these boundary condition as
- // early returns...
- if !_isContinuation(right[_unchecked: idx]) {
- let (leftScalar, leftLen) = _decodeScalar(left, startingAt: idx)
- let (rightScalar, rightLen) = _decodeScalar(right, startingAt: idx)
- _internalInvariant(leftScalar != rightScalar)
+ let (leftScalar, leftLen) = _decodeScalar(utf8Left, startingAt: scalarDiffIdx)
+ let (rightScalar, rightLen) = _decodeScalar(
+ utf8Right, startingAt: scalarDiffIdx)
- let nfcQC = leftScalar._isNFCQCYes && rightScalar._isNFCQCYes
- let isSegmentEnd = left.hasNormalizationBoundary(before: idx + leftLen)
- && right.hasNormalizationBoundary(before: idx + rightLen)
- if _fastPath(nfcQC && isSegmentEnd) {
- return expecting == _lexicographicalCompare(leftScalar, rightScalar)
+ // Very frequent fast-path: point of binary divergence is a NFC single-scalar
+ // segment. Check that we diverged at the start of a segment, and the next
+ // scalar is both NFC and its own segment.
+ if _fastPath(
+ leftScalar._isNFCStarter && rightScalar._isNFCStarter &&
+ utf8Left.hasNormalizationBoundary(before: scalarDiffIdx &+ leftLen) &&
+ utf8Right.hasNormalizationBoundary(before: scalarDiffIdx &+ rightLen)
+ ) {
+ guard expecting == .less else {
+ // We diverged
+ _internalInvariant(expecting == .equal)
+ return false
}
+ return _lexicographicalCompare(
+ leftScalar.value, rightScalar.value, expecting: .less)
}
- // TODO: Back up to start of segment, and slow-path resume from there
+ // Back up to the nearest normalization boundary before doing a slow
+ // normalizing compare.
+ let boundaryIdx = Swift.min(
+ _findBoundary(utf8Left, before: diffIdx),
+ _findBoundary(utf8Right, before: diffIdx))
+ _internalInvariant(boundaryIdx <= diffIdx)
- return _StringGutsSlice(_StringGuts(left, isASCII: false)).compare(with:
- _StringGutsSlice(_StringGuts(right, isASCII: false)), expecting: expecting)
+ return _stringCompareSlow(
+ UnsafeBufferPointer(rebasing: utf8Left[boundaryIdx...]),
+ UnsafeBufferPointer(rebasing: utf8Right[boundaryIdx...]),
+ expecting: expecting)
+}
+
+@_effects(readonly)
+private func _stringCompareSlow(
+ _ lhs: _StringGuts, _ rhs: _StringGuts, expecting: _StringComparisonResult
+) -> Bool {
+ return _stringCompareSlow(
+ lhs, 0..<lhs.count, rhs, 0..<rhs.count, expecting: expecting)
+}
+
+@_effects(readonly)
+private func _stringCompareSlow(
+ _ lhs: _StringGuts, _ lhsRange: Range<Int>,
+ _ rhs: _StringGuts, _ rhsRange: Range<Int>,
+ expecting: _StringComparisonResult
+) -> Bool {
+ // TODO: Just call the normalizer directly with range
+
+ return _StringGutsSlice(lhs, lhsRange).compare(
+ with: _StringGutsSlice(rhs, rhsRange),
+ expecting: expecting)
+}
+
+@_effects(readonly)
+private func _stringCompareSlow(
+ _ leftUTF8: UnsafeBufferPointer<UInt8>,
+ _ rightUTF8: UnsafeBufferPointer<UInt8>,
+ expecting: _StringComparisonResult
+) -> Bool {
+ // TODO: Just call the normalizer directly
+
+ let left = _StringGutsSlice(_StringGuts(leftUTF8, isASCII: false))
+ let right = _StringGutsSlice(_StringGuts(rightUTF8, isASCII: false))
+ return left.compare(with: right, expecting: expecting)
+}
+
+// Return the point of binary divergence. If they have no binary difference
+// (even if one is longer), returns nil.
+@_effects(readonly)
+private func _findDiffIdx(
+ _ left: UnsafeBufferPointer<UInt8>, _ right: UnsafeBufferPointer<UInt8>
+) -> Int? {
+ let count = Swift.min(left.count, right.count)
+ var idx = 0
+ while idx < count {
+ guard left[_unchecked: idx] == right[_unchecked: idx] else {
+ return idx
+ }
+ idx &+= 1
+ }
+ return nil
+}
+
+@_effects(readonly)
+@inline(__always)
+private func _lexicographicalCompare<I: FixedWidthInteger>(
+ _ lhs: I, _ rhs: I, expecting: _StringComparisonResult
+) -> Bool {
+ return expecting == .equal ? lhs == rhs : lhs < rhs
+}
+
+@_effects(readonly)
+private func _findBoundary(
+ _ utf8: UnsafeBufferPointer<UInt8>, before: Int
+) -> Int {
+ var idx = before
+ _internalInvariant(idx >= 0)
+
+ // End of string is a normalization boundary
+ guard idx < utf8.count else {
+ _internalInvariant(before == utf8.count)
+ return utf8.count
+ }
+
+ // Back up to scalar boundary
+ while _isContinuation(utf8[_unchecked: idx]) {
+ idx &-= 1
+ }
+
+ while true {
+ if idx == 0 { return 0 }
+
+ let scalar = _decodeScalar(utf8, startingAt: idx).0
+ if scalar._hasNormalizationBoundaryBefore { return idx }
+
+ idx &-= _utf8ScalarLength(utf8, endingAt: idx)
+ }
}
@_frozen
@usableFromInline
internal enum _StringComparisonResult {
- case less
case equal
- case greater
+ case less
@inlinable @inline(__always)
internal init(signedNotation int: Int) {
- self = int < 0 ? .less : int == 0 ? .equal : .greater
+ _internalInvariant(int <= 0)
+ self = int == 0 ? .equal : .less
+ }
+
+ @inlinable @inline(__always)
+ static func ==(
+ _ lhs: _StringComparisonResult, _ rhs: _StringComparisonResult
+ ) -> Bool {
+ switch (lhs, rhs) {
+ case (.equal, .equal): return true
+ case (.less, .less): return true
+ default: return false
+ }
}
}
@@ -192,7 +287,7 @@
// Perform a binary comparison of bytes in memory. Return value is negative if
// less, 0 if equal, positive if greater.
-@inlinable @inline(__always) // Memcmp wrapper
+@_effects(readonly)
internal func _binaryCompare<UInt8>(
_ lhs: UnsafeBufferPointer<UInt8>, _ rhs: UnsafeBufferPointer<UInt8>
) -> Int {
@@ -209,26 +304,10 @@
// Double dispatch functions
extension _StringGutsSlice {
- @usableFromInline
@_effects(readonly)
internal func compare(
with other: _StringGutsSlice, expecting: _StringComparisonResult
) -> Bool {
- if self._guts.rawBits == other._guts.rawBits
- && self._offsetRange == other._offsetRange {
- return expecting == .equal
- }
-
- if _fastPath(self.isNFCFastUTF8 && other.isNFCFastUTF8) {
- Builtin.onFastPath() // aggressively inline / optimize
- return self.withFastUTF8 { nfcSelf in
- return other.withFastUTF8 { nfcOther in
- return expecting == _StringComparisonResult(
- signedNotation: _binaryCompare(nfcSelf, nfcOther))
- }
- }
- }
-
if _fastPath(self.isFastUTF8 && other.isFastUTF8) {
Builtin.onFastPath() // aggressively inline / optimize
let isEqual = self.withFastUTF8 { utf8Self in
@@ -239,35 +318,21 @@
if isEqual { return expecting == .equal }
}
- return expecting == _slowCompare(with: other)
+ return _slowCompare(with: other, expecting: expecting)
}
@inline(never) // opaque slow-path
@_effects(readonly)
internal func _slowCompare(
- with other: _StringGutsSlice
- ) -> _StringComparisonResult {
+ with other: _StringGutsSlice,
+ expecting: _StringComparisonResult
+ ) -> Bool {
return self.withNFCCodeUnitsIterator_2 {
var selfIter = $0
return other.withNFCCodeUnitsIterator_2 {
let otherIter = $0
- return selfIter.compare(with: otherIter)
+ return selfIter.compare(with: otherIter, expecting: expecting)
}
}
}
}
-
-@inline(__always)
-internal func _lexicographicalCompare<I: FixedWidthInteger>(
- _ lhs: I, _ rhs: I
-) -> _StringComparisonResult {
- return lhs < rhs ? .less : (lhs > rhs ? .greater : .equal)
-}
-@inline(__always)
-internal func _lexicographicalCompare(
- _ lhs: Unicode.Scalar, _ rhs: Unicode.Scalar
-) -> _StringComparisonResult {
- return _lexicographicalCompare(lhs.value, rhs.value)
-}
-
-
diff --git a/stdlib/public/core/StringGuts.swift b/stdlib/public/core/StringGuts.swift
index c7cb416..f6413e2 100644
--- a/stdlib/public/core/StringGuts.swift
+++ b/stdlib/public/core/StringGuts.swift
@@ -153,18 +153,11 @@
@inlinable @inline(__always)
internal func withFastUTF8<R>(
- range: Range<Int>?,
+ range: Range<Int>,
_ f: (UnsafeBufferPointer<UInt8>) throws -> R
) rethrows -> R {
return try self.withFastUTF8 { wholeUTF8 in
- let slicedUTF8: UnsafeBufferPointer<UInt8>
- if let r = range {
- slicedUTF8 = UnsafeBufferPointer(rebasing: wholeUTF8[r])
- } else {
- slicedUTF8 = wholeUTF8
- }
-
- return try f(slicedUTF8)
+ return try f(UnsafeBufferPointer(rebasing: wholeUTF8[range]))
}
}
diff --git a/stdlib/public/core/StringNormalization.swift b/stdlib/public/core/StringNormalization.swift
index 0515b4e..82de988 100644
--- a/stdlib/public/core/StringNormalization.swift
+++ b/stdlib/public/core/StringNormalization.swift
@@ -35,3 +35,70 @@
internal static let _maxNFCExpansionFactor = 3
}
+extension Unicode.Scalar {
+ // Normalization boundary - a place in a string where everything left of the
+ // boundary can be normalized independently from everything right of the
+ // boundary. The concatenation of each result is the same as if the entire
+ // string had been normalized as a whole.
+ //
+ // Normalization segment - a sequence of code units between two normalization
+ // boundaries (without any boundaries in the middle). Note that normalization
+ // segments can, as a process of normalization, expand, contract, and even
+ // produce new sub-segments.
+
+ // Whether this scalar value always has a normalization boundary before it.
+ @inline(__always) // common fast-path
+ internal var _hasNormalizationBoundaryBefore: Bool {
+ // Fast-path: All scalars up through U+02FF are NFC and have boundaries
+ // before them
+ if self.value < 0x300 { return true }
+
+ _internalInvariant(Int32(exactly: self.value) != nil, "top bit shouldn't be set")
+ let value = Int32(bitPattern: self.value)
+ return 0 != __swift_stdlib_unorm2_hasBoundaryBefore(
+ _Normalization._nfcNormalizer, value)
+ }
+ @inline(__always) // common fast-path
+ internal var _isNFCQCYes: Bool {
+ // Fast-path: All scalars up through U+02FF are NFC and have boundaries
+ // before them
+ if self.value < 0x300 { return true }
+
+ return __swift_stdlib_u_getIntPropertyValue(
+ Builtin.reinterpretCast(value), __swift_stdlib_UCHAR_NFC_QUICK_CHECK
+ ) == 1
+ }
+
+ // Quick check if a scalar is NFC and a segment starter
+ internal var _isNFCStarter: Bool {
+ // Otherwise, consult the properties
+ return self._hasNormalizationBoundaryBefore && self._isNFCQCYes
+ }
+}
+
+internal func _tryNormalize(
+ _ input: UnsafeBufferPointer<UInt16>,
+ into outputBuffer:
+ UnsafeMutablePointer<_Normalization._SegmentOutputBuffer>
+) -> Int? {
+ return _tryNormalize(input, into: _castOutputBuffer(outputBuffer))
+}
+internal func _tryNormalize(
+ _ input: UnsafeBufferPointer<UInt16>,
+ into outputBuffer: UnsafeMutableBufferPointer<UInt16>
+) -> Int? {
+ var err = __swift_stdlib_U_ZERO_ERROR
+ let count = __swift_stdlib_unorm2_normalize(
+ _Normalization._nfcNormalizer,
+ input.baseAddress._unsafelyUnwrappedUnchecked,
+ numericCast(input.count),
+ outputBuffer.baseAddress._unsafelyUnwrappedUnchecked,
+ numericCast(outputBuffer.count),
+ &err
+ )
+ guard err.isSuccess else {
+ // The output buffer needs to grow
+ return nil
+ }
+ return numericCast(count)
+}
diff --git a/stdlib/public/core/UnicodeHelpers.swift b/stdlib/public/core/UnicodeHelpers.swift
index 73f2be3..986734b 100644
--- a/stdlib/public/core/UnicodeHelpers.swift
+++ b/stdlib/public/core/UnicodeHelpers.swift
@@ -130,7 +130,7 @@
) -> Int {
var len = 1
while _isContinuation(utf8[_unchecked: i &- len]) {
- len += 1
+ len &+= 1
}
_internalInvariant(len == _utf8ScalarLength(utf8[i &- len]))
return len
@@ -174,12 +174,25 @@
return scalar.value <= UInt16.max ? 1 : 2
}
+@inlinable @inline(__always)
+internal func _scalarAlign(
+ _ utf8: UnsafeBufferPointer<UInt8>, _ idx: Int
+) -> Int {
+ var i = idx
+ while _slowPath(_isContinuation(utf8[_unchecked: i])) {
+ i &-= 1
+ _internalInvariant(i >= 0,
+ "Malformed contents: starts with continuation byte")
+ }
+ return i
+}
+
//
// Scalar helpers
//
extension _StringGuts {
- @inlinable // FIXME(inline-always) was usableFromInline
- @inline(__always) // fast-path: fold common fastUTF8 check
+ @inlinable
+ @inline(__always) // fast-path: fold common fastUTF8 check
internal func scalarAlign(_ idx: Index) -> Index {
// TODO(String performance): isASCII check
@@ -192,12 +205,8 @@
}
return self.withFastUTF8 { utf8 in
- var i = idx.encodedOffset
- while _slowPath(_isContinuation(utf8[_unchecked: i])) {
- i -= 1
- _internalInvariant(
- i >= 0, "Malformed contents: starts with continuation byte")
- }
+ let i = _scalarAlign(utf8, idx.encodedOffset)
+
// If no alignment is performed, keep grapheme cache
if i == idx.encodedOffset {
return idx
@@ -222,8 +231,8 @@
return self.withFastUTF8 { utf8 in
_internalInvariant(i == utf8.count || !_isContinuation(utf8[i]))
var len = 1
- while _isContinuation(utf8[i - len]) {
- _internalInvariant(i - len > 0)
+ while _isContinuation(utf8[i &- len]) {
+ _internalInvariant(i &- len > 0)
len += 1
}
_internalInvariant(len <= 4)
diff --git a/stdlib/public/runtime/Casting.cpp b/stdlib/public/runtime/Casting.cpp
index 3b45149..5efb7c4 100644
--- a/stdlib/public/runtime/Casting.cpp
+++ b/stdlib/public/runtime/Casting.cpp
@@ -635,23 +635,13 @@
// If we do find one, the cast succeeds.
- // The intrinsic wants the value at +1, so we have to copy it into
- // a temporary.
- ValueBuffer buffer;
- bool mustDeallocBuffer = false;
- if (!(flags & DynamicCastFlags::TakeOnSuccess)) {
- auto *valueAddr = sourceType->allocateBufferIn(&buffer);
- source = sourceType->vw_initializeWithCopy(valueAddr, source);
- mustDeallocBuffer = true;
- }
-
// Initialize the destination.
_swift_convertToAnyHashableIndirect(source, destination,
sourceType, hashableConformance);
- // Deallocate the buffer if we used it.
- if (mustDeallocBuffer) {
- sourceType->deallocateBufferIn(&buffer);
+ // Destroy the value if requested.
+ if (flags & DynamicCastFlags::TakeOnSuccess) {
+ sourceType->vw_destroy(source);
}
// The cast succeeded.
@@ -1932,6 +1922,9 @@
#if !SWIFT_OBJC_INTEROP // __SwiftValue is a native class:
if (swift_unboxFromSwiftValueWithType(src, dest, targetType)) {
+ // Release the source if we need to.
+ if (flags & DynamicCastFlags::TakeOnSuccess)
+ srcType->vw_destroy(src);
return true;
}
#endif
diff --git a/stdlib/public/runtime/CompatibilityOverride.def b/stdlib/public/runtime/CompatibilityOverride.def
index b8d99de..4906a96 100644
--- a/stdlib/public/runtime/CompatibilityOverride.def
+++ b/stdlib/public/runtime/CompatibilityOverride.def
@@ -130,6 +130,13 @@
const ProtocolDescriptor *protocol),
(type, protocol))
+OVERRIDE_PROTOCOLCONFORMANCE(conformsToSwiftProtocol,
+ const ProtocolConformanceDescriptor *, , swift::,
+ (const Metadata * const type,
+ const ProtocolDescriptor *protocol,
+ StringRef moduleName),
+ (type, protocol, moduleName))
+
OVERRIDE_KEYPATH(getKeyPath, const HeapObject *, , swift::,
(const void *pattern, const void *arguments),
(pattern, arguments))
diff --git a/stdlib/public/runtime/Metadata.cpp b/stdlib/public/runtime/Metadata.cpp
index 9d76bfb..0f3b905 100644
--- a/stdlib/public/runtime/Metadata.cpp
+++ b/stdlib/public/runtime/Metadata.cpp
@@ -310,12 +310,39 @@
};
} // end anonymous namespace
-using GenericMetadataCache = MetadataCache<GenericCacheEntry, false>;
-using LazyGenericMetadataCache = Lazy<GenericMetadataCache>;
+namespace {
+ class GenericMetadataCache : public MetadataCache<GenericCacheEntry, false> {
+ public:
+ uint16_t NumKeyParameters;
+ uint16_t NumWitnessTables;
+
+ GenericMetadataCache(const TargetGenericContext<InProcess> &genericContext)
+ : NumKeyParameters(0), NumWitnessTables(0) {
+ // Count up the # of key parameters and # of witness tables.
+
+ // Find key generic parameters.
+ for (const auto &gp : genericContext.getGenericParams()) {
+ if (gp.hasKeyArgument())
+ ++NumKeyParameters;
+ }
+
+ // Find witness tables.
+ for (const auto &req : genericContext.getGenericRequirements()) {
+ if (req.Flags.hasKeyArgument() &&
+ req.getKind() == GenericRequirementKind::Protocol)
+ ++NumWitnessTables;
+ }
+ }
+ };
+
+ using LazyGenericMetadataCache = Lazy<GenericMetadataCache>;
+}
/// Fetch the metadata cache for a generic metadata structure.
static GenericMetadataCache &getCache(
- const TypeGenericContextDescriptorHeader &generics) {
+ const TypeContextDescriptor &description) {
+ auto &generics = description.getFullGenericContextHeader();
+
// Keep this assert even if you change the representation above.
static_assert(sizeof(LazyGenericMetadataCache) <=
sizeof(GenericMetadataInstantiationCache::PrivateData),
@@ -324,7 +351,7 @@
auto lazyCache =
reinterpret_cast<LazyGenericMetadataCache*>(
generics.getInstantiationCache()->PrivateData);
- return lazyCache->get();
+ return lazyCache->getWithInit(*description.getGenericContext());
}
/// Fetch the metadata cache for a generic metadata structure,
@@ -569,9 +596,11 @@
auto &generics = description->getFullGenericContextHeader();
size_t numGenericArgs = generics.Base.NumKeyArguments;
- auto key = MetadataCacheKey(arguments, numGenericArgs);
- auto result =
- getCache(generics).getOrInsert(key, request, description, arguments);
+ auto &cache = getCache(*description);
+ assert(numGenericArgs == cache.NumKeyParameters + cache.NumWitnessTables);
+ auto key = MetadataCacheKey(cache.NumKeyParameters, cache.NumWitnessTables,
+ arguments);
+ auto result = cache.getOrInsert(key, request, description, arguments);
return result.second;
}
@@ -798,6 +827,22 @@
return theClass;
}
+const ClassMetadata *
+swift::swift_getObjCClassFromMetadataConditional(const Metadata *theMetadata) {
+ // If it's an ordinary class, return it.
+ if (auto theClass = dyn_cast<ClassMetadata>(theMetadata)) {
+ return theClass;
+ }
+
+ // Unwrap ObjC class wrappers.
+ if (auto wrapper = dyn_cast<ObjCClassWrapperMetadata>(theMetadata)) {
+ return wrapper->Class;
+ }
+
+ // Not an ObjC class after all.
+ return nil;
+}
+
#endif
/***************************************************************************/
@@ -4384,11 +4429,15 @@
auto genericArgs =
reinterpret_cast<const void * const *>(
description->getGenericArguments(metadata));
+ auto &cache = getCache(*description);
size_t numGenericArgs = generics.Base.NumKeyArguments;
- auto key = MetadataCacheKey(genericArgs, numGenericArgs);
+ assert(numGenericArgs == cache.NumKeyParameters + cache.NumWitnessTables);
+ (void)numGenericArgs;
+ auto key = MetadataCacheKey(cache.NumKeyParameters, cache.NumWitnessTables,
+ genericArgs);
return std::move(callbacks).forGenericMetadata(metadata, description,
- getCache(generics), key);
+ cache, key);
}
bool swift::addToMetadataQueue(MetadataCompletionQueueEntry *queueEntry,
diff --git a/stdlib/public/runtime/MetadataCache.h b/stdlib/public/runtime/MetadataCache.h
index e87d4d9..bc1f811 100644
--- a/stdlib/public/runtime/MetadataCache.h
+++ b/stdlib/public/runtime/MetadataCache.h
@@ -354,25 +354,85 @@
/// A key value as provided to the concurrent map.
class MetadataCacheKey {
const void * const *Data;
- uint32_t Length;
+ uint16_t NumKeyParameters;
+ uint16_t NumWitnessTables;
uint32_t Hash;
+ /// Compare two witness tables, which may involving checking the
+ /// contents of their conformance descriptors.
+ static int compareWitnessTables(const WitnessTable *awt,
+ const WitnessTable *bwt) {
+ if (awt == bwt)
+ return 0;
+
+ auto *aDescription = awt->Description;
+ auto *bDescription = bwt->Description;
+ if (aDescription == bDescription)
+ return 0;
+
+ if (!aDescription->isSynthesizedNonUnique() ||
+ !bDescription->isSynthesizedNonUnique())
+ return comparePointers(aDescription, bDescription);
+
+ auto aType = aDescription->getCanonicalTypeMetadata();
+ auto bType = bDescription->getCanonicalTypeMetadata();
+ if (!aType || !bType)
+ return comparePointers(aDescription, bDescription);
+
+ if (int result = comparePointers(aType, bType))
+ return result;
+
+ return comparePointers(aDescription->getProtocol(),
+ bDescription->getProtocol());
+ }
+
+ /// Compare the content from two keys.
+ static int compareContent(const void * const *adata,
+ const void * const *bdata,
+ unsigned numKeyParameters,
+ unsigned numWitnessTables) {
+ // Compare generic arguments for key parameters.
+ for (unsigned i = 0; i != numKeyParameters; ++i) {
+ if (auto result = comparePointers(*adata++, *bdata++))
+ return result;
+ }
+
+ // Compare witness tables.
+ for (unsigned i = 0; i != numWitnessTables; ++i) {
+ if (auto result =
+ compareWitnessTables((const WitnessTable *)*adata++,
+ (const WitnessTable *)*bdata++))
+ return result;
+ }
+
+ return 0;
+ }
+
public:
- MetadataCacheKey(const void * const *data, size_t size)
- : Data(data), Length(size), Hash(computeHash()) {}
- MetadataCacheKey(const void * const *data, size_t size, uint32_t hash)
- : Data(data), Length(size), Hash(hash) {}
+ MetadataCacheKey(uint16_t numKeyParams,
+ uint16_t numWitnessTables,
+ const void * const *data)
+ : Data(data), NumKeyParameters(numKeyParams),
+ NumWitnessTables(numWitnessTables), Hash(computeHash()) { }
+
+ MetadataCacheKey(uint16_t numKeyParams,
+ uint16_t numWitnessTables,
+ const void * const *data,
+ uint32_t hash)
+ : Data(data), NumKeyParameters(numKeyParams),
+ NumWitnessTables(numWitnessTables), Hash(hash) {}
bool operator==(MetadataCacheKey rhs) const {
+ // Compare the hashes.
+ if (hash() != rhs.hash()) return false;
+
// Compare the sizes.
- unsigned asize = size(), bsize = rhs.size();
- if (asize != bsize) return false;
+ if (NumKeyParameters != rhs.NumKeyParameters) return false;
+ if (NumWitnessTables != rhs.NumWitnessTables) return false;
// Compare the content.
- auto abegin = begin(), bbegin = rhs.begin();
- for (unsigned i = 0; i < asize; ++i)
- if (abegin[i] != bbegin[i]) return false;
- return true;
+ return compareContent(begin(), rhs.begin(), NumKeyParameters,
+ NumWitnessTables) == 0;
}
int compare(const MetadataCacheKey &rhs) const {
@@ -381,38 +441,43 @@
return hashComparison;
}
- // Compare the sizes.
- if (auto sizeComparison = compareIntegers(size(), rhs.size())) {
- return sizeComparison;
+ // Compare the # of key parameters.
+ if (auto keyParamsComparison =
+ compareIntegers(NumKeyParameters, rhs.NumKeyParameters)) {
+ return keyParamsComparison;
+ }
+
+ // Compare the # of witness tables.
+ if (auto witnessTablesComparison =
+ compareIntegers(NumWitnessTables, rhs.NumWitnessTables)) {
+ return witnessTablesComparison;
}
// Compare the content.
- auto lbegin = begin(), rbegin = rhs.begin();
- for (unsigned i = 0, e = size(); i != e; ++i) {
- if (auto ptrComparison = comparePointers(lbegin[i], rbegin[i]))
- return ptrComparison;
- }
-
- // Equal.
- return 0;
+ return compareContent(begin(), rhs.begin(), NumKeyParameters,
+ NumWitnessTables);
}
+ uint16_t numKeyParameters() const { return NumKeyParameters; }
+ uint16_t numWitnessTables() const { return NumWitnessTables; }
+
uint32_t hash() const {
return Hash;
}
const void * const *begin() const { return Data; }
- const void * const *end() const { return Data + Length; }
- unsigned size() const { return Length; }
+ const void * const *end() const { return Data + size(); }
+ unsigned size() const { return NumKeyParameters + NumWitnessTables; }
private:
uint32_t computeHash() const {
- size_t H = 0x56ba80d1 * Length;
- for (unsigned i = 0; i < Length; i++) {
+ size_t H = 0x56ba80d1 * NumKeyParameters;
+ for (unsigned index = 0; index != NumKeyParameters; ++index) {
H = (H >> 10) | (H << ((sizeof(size_t) * 8) - 10));
- H ^= (reinterpret_cast<size_t>(Data[i])
- ^ (reinterpret_cast<size_t>(Data[i]) >> 19));
+ H ^= (reinterpret_cast<size_t>(Data[index])
+ ^ (reinterpret_cast<size_t>(Data[index]) >> 19));
}
+
H *= 0x27d4eb2d;
// Rotate right by 10 and then truncate to 32 bits.
@@ -1270,7 +1335,7 @@
using OverloadToken = typename TrailingObjects::template OverloadToken<T>;
size_t numTrailingObjects(OverloadToken<const void *>) const {
- return KeyLength;
+ return NumKeyParameters + NumWitnessTables;
}
template <class... Args>
@@ -1284,7 +1349,8 @@
// These are arranged to fit into the tail-padding of the superclass.
/// These are set during construction and never changed.
- const uint16_t KeyLength;
+ const uint16_t NumKeyParameters;
+ const uint16_t NumWitnessTables;
const uint32_t Hash;
/// Valid if TrackingInfo.getState() >= PrivateMetadataState::Abstract.
@@ -1300,14 +1366,17 @@
public:
VariadicMetadataCacheEntryBase(const MetadataCacheKey &key)
- : KeyLength(key.size()), Hash(key.hash()) {
+ : NumKeyParameters(key.numKeyParameters()),
+ NumWitnessTables(key.numWitnessTables()),
+ Hash(key.hash()) {
memcpy(this->template getTrailingObjects<const void *>(),
key.begin(), key.size() * sizeof(const void *));
}
MetadataCacheKey getKey() const {
- return MetadataCacheKey(this->template getTrailingObjects<const void*>(),
- KeyLength, Hash);
+ return MetadataCacheKey(NumKeyParameters, NumWitnessTables,
+ this->template getTrailingObjects<const void*>(),
+ Hash);
}
intptr_t getKeyIntValueForDump() const {
diff --git a/stdlib/public/runtime/MetadataLookup.cpp b/stdlib/public/runtime/MetadataLookup.cpp
index f4a83c3..7f0abdd 100644
--- a/stdlib/public/runtime/MetadataLookup.cpp
+++ b/stdlib/public/runtime/MetadataLookup.cpp
@@ -47,6 +47,7 @@
#include <objc/runtime.h>
#include <objc/message.h>
#include <objc/objc.h>
+#include <dlfcn.h>
#endif
/// Produce a Demangler value suitable for resolving runtime type metadata
@@ -1284,6 +1285,63 @@
return swift_checkMetadataState(MetadataState::Complete, metadata).Value;
}
+#if SWIFT_OBJC_INTEROP
+
+// Return the ObjC class for the given type name.
+// This gets installed as a callback from libobjc.
+
+// FIXME: delete this #if and dlsym once we don't
+// need to build with older libobjc headers
+#if !OBJC_GETCLASSHOOK_DEFINED
+using objc_hook_getClass = BOOL(*)(const char * _Nonnull name,
+ Class _Nullable * _Nonnull outClass);
+#endif
+static objc_hook_getClass OldGetClassHook;
+
+static BOOL
+getObjCClassByMangledName(const char * _Nonnull typeName,
+ Class _Nullable * _Nonnull outClass) {
+ auto metadata = swift_stdlib_getTypeByMangledName(typeName, strlen(typeName),
+ /* no substitutions */
+ nullptr, nullptr);
+ if (metadata) {
+ auto objcClass =
+ reinterpret_cast<Class>(
+ const_cast<ClassMetadata *>(
+ swift_getObjCClassFromMetadataConditional(metadata)));
+
+ if (objcClass) {
+ *outClass = objcClass;
+ return YES;
+ }
+ }
+
+ return OldGetClassHook(typeName, outClass);
+}
+
+__attribute__((constructor))
+static void installGetClassHook() {
+ // FIXME: delete this #if and dlsym once we don't
+ // need to build with older libobjc headers
+#if !OBJC_GETCLASSHOOK_DEFINED
+ using objc_hook_getClass = BOOL(*)(const char * _Nonnull name,
+ Class _Nullable * _Nonnull outClass);
+ auto objc_setHook_getClass =
+ (void(*)(objc_hook_getClass _Nonnull,
+ objc_hook_getClass _Nullable * _Nonnull))
+ dlsym(RTLD_DEFAULT, "objc_setHook_getClass");
+#endif
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunguarded-availability"
+ if (objc_setHook_getClass) {
+ objc_setHook_getClass(getObjCClassByMangledName, &OldGetClassHook);
+ }
+#pragma clang diagnostic pop
+}
+
+#endif
+
unsigned SubstGenericParametersFromMetadata::
buildDescriptorPath(const ContextDescriptor *context) const {
// Terminating condition: we don't have a context.
diff --git a/stdlib/public/runtime/Private.h b/stdlib/public/runtime/Private.h
index d064a51..f5571c9 100644
--- a/stdlib/public/runtime/Private.h
+++ b/stdlib/public/runtime/Private.h
@@ -507,6 +507,13 @@
const Metadata *type,
const ProtocolConformanceDescriptor *conformance);
+ /// Determine whether the given type conforms to the given Swift protocol,
+ /// returning the appropriate protocol conformance descriptor when it does.
+ const ProtocolConformanceDescriptor *
+ swift_conformsToSwiftProtocol(const Metadata * const type,
+ const ProtocolDescriptor *protocol,
+ StringRef module);
+
/// Retrieve an associated type witness from the given witness table.
///
/// \param wtable The witness table.
diff --git a/stdlib/public/runtime/ProtocolConformance.cpp b/stdlib/public/runtime/ProtocolConformance.cpp
index 5bd8f81..f3e5b2a 100644
--- a/stdlib/public/runtime/ProtocolConformance.cpp
+++ b/stdlib/public/runtime/ProtocolConformance.cpp
@@ -200,14 +200,14 @@
private:
const void *Type;
const ProtocolDescriptor *Proto;
- std::atomic<const WitnessTable *> Table;
+ std::atomic<const ProtocolConformanceDescriptor *> Description;
std::atomic<size_t> FailureGeneration;
public:
ConformanceCacheEntry(ConformanceCacheKey key,
- const WitnessTable *table,
+ const ProtocolConformanceDescriptor *description,
size_t failureGeneration)
- : Type(key.Type), Proto(key.Proto), Table(table),
+ : Type(key.Type), Proto(key.Proto), Description(description),
FailureGeneration(failureGeneration) {
}
@@ -227,22 +227,22 @@
}
bool isSuccessful() const {
- return Table.load(std::memory_order_relaxed) != nullptr;
+ return Description.load(std::memory_order_relaxed) != nullptr;
}
- void makeSuccessful(const WitnessTable *table) {
- Table.store(table, std::memory_order_release);
+ void makeSuccessful(const ProtocolConformanceDescriptor *description) {
+ Description.store(description, std::memory_order_release);
}
void updateFailureGeneration(size_t failureGeneration) {
assert(!isSuccessful());
FailureGeneration.store(failureGeneration, std::memory_order_relaxed);
}
-
- /// Get the cached witness table, if successful.
- const WitnessTable *getWitnessTable() const {
+
+ /// Get the cached conformance descriptor, if successful.
+ const ProtocolConformanceDescriptor *getDescription() const {
assert(isSuccessful());
- return Table.load(std::memory_order_acquire);
+ return Description.load(std::memory_order_acquire);
}
/// Get the generation in which this lookup failed.
@@ -263,21 +263,22 @@
}
void cacheSuccess(const void *type, const ProtocolDescriptor *proto,
- const WitnessTable *witness) {
+ const ProtocolConformanceDescriptor *description) {
auto result = Cache.getOrInsert(ConformanceCacheKey(type, proto),
- witness, 0);
+ description, 0);
// If the entry was already present, we may need to update it.
if (!result.second) {
- result.first->makeSuccessful(witness);
+ result.first->makeSuccessful(description);
}
}
void cacheFailure(const void *type, const ProtocolDescriptor *proto,
size_t failureGeneration) {
- auto result = Cache.getOrInsert(ConformanceCacheKey(type, proto),
- (const WitnessTable *) nullptr,
- failureGeneration);
+ auto result =
+ Cache.getOrInsert(ConformanceCacheKey(type, proto),
+ (const ProtocolConformanceDescriptor *) nullptr,
+ failureGeneration);
// If the entry was already present, we may need to update it.
if (!result.second) {
@@ -344,21 +345,22 @@
struct ConformanceCacheResult {
- // true if witnessTable is an authoritative result as-is.
+ // true if description is an authoritative result as-is.
// false if more searching is required (for example, because a cached
// failure was returned in failureEntry but it is out-of-date.
bool isAuthoritative;
- // The matching witness table, or null if no cached conformance was found.
- const WitnessTable *witnessTable;
+ // The matching conformance descriptor, or null if no cached conformance
+ // was found.
+ const ProtocolConformanceDescriptor *description;
// If the search fails, this may be the negative cache entry for the
// queried type itself. This entry may be null or out-of-date.
ConformanceCacheEntry *failureEntry;
static ConformanceCacheResult
- cachedSuccess(const WitnessTable *table) {
- return ConformanceCacheResult { true, table, nullptr };
+ cachedSuccess(const ProtocolConformanceDescriptor *description) {
+ return ConformanceCacheResult { true, description, nullptr };
}
static ConformanceCacheResult
@@ -381,7 +383,7 @@
return type;
}
-/// Search for a witness table in the ConformanceCache.
+/// Search for a conformance descriptor in the ConformanceCache.
static
ConformanceCacheResult
searchInConformanceCache(const Metadata *type,
@@ -396,7 +398,7 @@
if (auto *Value = C.findCached(type, protocol)) {
if (Value->isSuccessful()) {
// Found a conformance on the type or some superclass. Return it.
- return ConformanceCacheResult::cachedSuccess(Value->getWitnessTable());
+ return ConformanceCacheResult::cachedSuccess(Value->getDescription());
}
// Found a negative cache entry.
@@ -438,7 +440,7 @@
// Hash and lookup the type-protocol pair in the cache.
if (auto *Value = C.findCached(typeKey, protocol)) {
if (Value->isSuccessful())
- return ConformanceCacheResult::cachedSuccess(Value->getWitnessTable());
+ return ConformanceCacheResult::cachedSuccess(Value->getDescription());
// We don't try to cache negative responses for generic
// patterns.
@@ -530,9 +532,10 @@
};
}
-static const WitnessTable *
-swift_conformsToProtocolImpl(const Metadata * const type,
- const ProtocolDescriptor *protocol) {
+static const ProtocolConformanceDescriptor *
+swift_conformsToSwiftProtocolImpl(const Metadata * const type,
+ const ProtocolDescriptor *protocol,
+ StringRef module) {
auto &C = Conformances.get();
// See if we have a cached conformance. The ConcurrentMap data structure
@@ -540,7 +543,7 @@
auto FoundConformance = searchInConformanceCache(type, protocol);
// If the result (positive or negative) is authoritative, return it.
if (FoundConformance.isAuthoritative)
- return FoundConformance.witnessTable;
+ return FoundConformance.description;
auto failureEntry = FoundConformance.failureEntry;
@@ -560,16 +563,6 @@
return nullptr;
}
- /// Local function to retrieve the witness table and record the result.
- auto recordWitnessTable = [&](const ProtocolConformanceDescriptor &descriptor,
- const Metadata *type) {
- auto witnessTable = descriptor.getWitnessTable(type);
- if (witnessTable)
- C.cacheSuccess(type, protocol, witnessTable);
- else
- C.cacheFailure(type, protocol, snapshot.count());
- };
-
// Really scan conformance records.
for (size_t i = startIndex; i < endIndex; i++) {
auto §ion = snapshot.Start[i];
@@ -588,23 +581,34 @@
if (!matchingType)
matchingType = type;
- recordWitnessTable(descriptor, matchingType);
+ C.cacheSuccess(matchingType, protocol, &descriptor);
}
}
}
// Conformance scan is complete.
- // Search the cache once more, and this time update the cache if necessary.
+ // Search the cache once more, and this time update the cache if necessary.
FoundConformance = searchInConformanceCache(type, protocol);
if (FoundConformance.isAuthoritative) {
- return FoundConformance.witnessTable;
+ return FoundConformance.description;
} else {
C.cacheFailure(type, protocol, snapshot.count());
return nullptr;
}
}
+static const WitnessTable *
+swift_conformsToProtocolImpl(const Metadata * const type,
+ const ProtocolDescriptor *protocol) {
+ auto description =
+ swift_conformsToSwiftProtocol(type, protocol, StringRef());
+ if (!description)
+ return nullptr;
+
+ return description->getWitnessTable(type);
+}
+
const ContextDescriptor *
swift::_searchConformancesByMangledTypeName(Demangle::NodePointer node) {
auto &C = Conformances.get();
diff --git a/test/Constraints/closures.swift b/test/Constraints/closures.swift
index 0eaff39..93bf843 100644
--- a/test/Constraints/closures.swift
+++ b/test/Constraints/closures.swift
@@ -849,3 +849,12 @@
}
}
}
+
+func rdar45771997() {
+ struct S {
+ mutating func foo() {}
+ }
+
+ let _: Int = { (s: inout S) in s.foo() }
+ // expected-error@-1 {{cannot convert value of type '(inout S) -> ()' to specified type 'Int'}}
+}
diff --git a/test/Constraints/rdar44816848.swift b/test/Constraints/rdar44816848.swift
new file mode 100644
index 0000000..05791bc
--- /dev/null
+++ b/test/Constraints/rdar44816848.swift
@@ -0,0 +1,16 @@
+// RUN: %target-typecheck-verify-swift
+
+class A {}
+class B: A {}
+class C: A {}
+
+struct S {
+ func foo<T: A>(types: [T.Type]) {}
+}
+
+func bar(_ s: S, _ forced_s: S!) {
+ s.foo(types: [A.self, B.self]) // ok
+ s.foo(types: [B.self, A.self]) // ok
+ forced_s.foo(types: [A.self, B.self]) // ok
+ forced_s.foo(types: [B.self, A.self]) // ok
+}
diff --git a/test/Constraints/rdar46377919.swift b/test/Constraints/rdar46377919.swift
new file mode 100644
index 0000000..ffdaab5
--- /dev/null
+++ b/test/Constraints/rdar46377919.swift
@@ -0,0 +1,13 @@
+// RUN: %target-typecheck-verify-swift
+
+class Foo {
+ init(lhs: @autoclosure () -> Int,
+ rhs: @autoclosure () -> Undefined) {
+ // expected-error@-1 {{use of undeclared type 'Undefined'}}
+ }
+}
+
+func foo() -> Foo {
+ return Foo(lhs: 2, rhs: 2)
+ // expected-error@-1 {{cannot convert value of type 'Int' to expected argument type '<<error type>>'}}
+}
diff --git a/test/Constraints/sr9102.swift b/test/Constraints/sr9102.swift
new file mode 100644
index 0000000..e92567a
--- /dev/null
+++ b/test/Constraints/sr9102.swift
@@ -0,0 +1,5 @@
+// RUN: %target-typecheck-verify-swift
+
+func test(_ a: [Int], _ f: ((Int) -> Bool)?) {
+ _ = a.filter(f!)
+}
diff --git a/test/DebugInfo/generic_arg.swift b/test/DebugInfo/generic_arg.swift
index 9dfe7e8..0f22117 100644
--- a/test/DebugInfo/generic_arg.swift
+++ b/test/DebugInfo/generic_arg.swift
@@ -7,7 +7,7 @@
// CHECK-SAME: metadata ![[T1:.*]], metadata !DIExpression())
// CHECK: %[[X:.*]] = alloca %swift.opaque*
// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %[[X]],
- // CHECK-SAME: metadata ![[X1:.*]], metadata !DIExpression())
+ // CHECK-SAME: metadata ![[X1:.*]], metadata !DIExpression(DW_OP_deref))
// CHECK: store %swift.type* %T, %swift.type** %[[T]],
// CHECK: store %swift.opaque* %0, %swift.opaque** %[[X]],
// CHECK: ![[T1]] = !DILocalVariable(name: "$\CF\84_0_0",
diff --git a/test/DebugInfo/generic_arg2.swift b/test/DebugInfo/generic_arg2.swift
index 0fabaf2..c2e4c74 100644
--- a/test/DebugInfo/generic_arg2.swift
+++ b/test/DebugInfo/generic_arg2.swift
@@ -1,7 +1,7 @@
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
// CHECK: define hidden swiftcc void @"$s12generic_arg25ClassC3foo{{.*}}, %swift.type* %U
-// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %y.debug, metadata ![[U:.*]], metadata !DIExpression())
+// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %y.debug, metadata ![[U:.*]], metadata !DIExpression(DW_OP_deref))
// Make sure there is no conflicting dbg.value for this variable.x
// CHECK-NOT: dbg.value{{.*}}metadata ![[U]]
class Class <T> {
diff --git a/test/DebugInfo/generic_arg3.swift b/test/DebugInfo/generic_arg3.swift
index be9a52b..11ff6c5 100644
--- a/test/DebugInfo/generic_arg3.swift
+++ b/test/DebugInfo/generic_arg3.swift
@@ -6,7 +6,7 @@
{
// CHECK: define {{.*}}$s12generic_arg31fyyxlFxxXEfU_
// CHECK: call void @llvm.dbg.declare(metadata %swift.opaque** %[[ALLOCA:[^,]+]],
- // CHECK-SAME: metadata ![[ARG:.*]], metadata !DIExpression())
+ // CHECK-SAME: metadata ![[ARG:.*]], metadata !DIExpression(DW_OP_deref))
// CHECK: store %swift.opaque* %1, %swift.opaque** %[[ALLOCA]], align
// No deref here.
// CHECK: ![[TY:.*]] = !DICompositeType({{.*}}identifier: "$sxD"
diff --git a/test/Demangle/remangle.swift b/test/Demangle/remangle.swift
index 030e5f5..b75ae3d 100644
--- a/test/Demangle/remangle.swift
+++ b/test/Demangle/remangle.swift
@@ -9,3 +9,6 @@
// CHECK: Swift.(Mystruct in _7B40D7ED6632C2BEA2CA3BFFD57E3435)
RUN: swift-demangle -remangle-objc-rt '$ss8Mystruct33_7B40D7ED6632C2BEA2CA3BFFD57E3435LLV' | %FileCheck %s
+// CHECK-GENERICEXT: Swift._ContiguousArrayStorage<(extension in Swift):Swift.FlattenSequence<StdlibCollectionUnittest.MinimalBidirectionalCollection<StdlibCollectionUnittest.MinimalBidirectionalCollection<Swift.Int>>>.Index>
+RUN: swift-demangle -remangle-objc-rt '$ss23_ContiguousArrayStorageCys15FlattenSequenceVsE5IndexVy24StdlibCollectionUnittest020MinimalBidirectionalH0VyAIySiGG_GGD' | %FileCheck -check-prefix CHECK-GENERICEXT %s
+
diff --git a/test/Driver/linker.swift b/test/Driver/linker.swift
index 8f6741f..7a66713 100644
--- a/test/Driver/linker.swift
+++ b/test/Driver/linker.swift
@@ -49,6 +49,12 @@
// RUN: %swiftc_driver -driver-print-jobs -target armv7-unknown-linux-gnueabihf -Xlinker -rpath -Xlinker customrpath -L foo %s 2>&1 > %t.linux.txt
// RUN: %FileCheck -check-prefix LINUX-linker-order %s < %t.linux.txt
+// RUN: %swiftc_driver -driver-print-jobs -target x86_64-unknown-linux-gnu -Xclang-linker -foo -Xclang-linker foopath %s 2>&1 > %t.linux.txt
+// RUN: %FileCheck -check-prefix LINUX-clang-linker-order %s < %t.linux.txt
+
+// RUN: %swiftc_driver -driver-print-jobs -target x86_64-unknown-windows-msvc -Xclang-linker -foo -Xclang-linker foopath %s 2>&1 > %t.windows.txt
+// RUN: %FileCheck -check-prefix WINDOWS-clang-linker-order %s < %t.windows.txt
+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 -g %s | %FileCheck -check-prefix DEBUG %s
// RUN: %empty-directory(%t)
@@ -310,6 +316,20 @@
// LINUX-linker-order: -Xlinker -rpath -Xlinker customrpath
// LINUX-linker-order: -o {{.*}}
+// LINUX-clang-linker-order: swift
+// LINUX-clang-linker-order: -o [[OBJECTFILE:.*]]
+
+// LINUX-clang-linker-order: clang++{{"? }}
+// LINUX-clang-linker-order: -foo foopath
+// LINUX-clang-linker-order: -o {{.*}}
+
+// WINDOWS-clang-linker-order: swift
+// WINDOWS-clang-linker-order: -o [[OBJECTFILE:.*]]
+
+// WINDOWS-clang-linker-order: clang++{{"? }}
+// WINDOWS-clang-linker-order: -foo foopath
+// WINDOWS-clang-linker-order: -o {{.*}}
+
// DEBUG: bin/swift
// DEBUG-NEXT: bin/swift
// DEBUG-NEXT: bin/ld{{"? }}
@@ -390,4 +410,3 @@
// Clean up the test executable because hard links are expensive.
// RUN: rm -rf %t/DISTINCTIVE-PATH/usr/bin/swiftc
-
diff --git a/test/IDE/complete_call_arg.swift b/test/IDE/complete_call_arg.swift
index a99b42b..86703e2 100644
--- a/test/IDE/complete_call_arg.swift
+++ b/test/IDE/complete_call_arg.swift
@@ -11,6 +11,14 @@
// RUN-FIXME: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERLOAD2 | %FileCheck %s -check-prefix=OVERLOAD2
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERLOAD3 | %FileCheck %s -check-prefix=OVERLOAD3
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERLOAD4 | %FileCheck %s -check-prefix=OVERLOAD4
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERLOAD5 | %FileCheck %s -check-prefix=OVERLOAD5
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERLOAD6 | %FileCheck %s -check-prefix=OVERLOAD6
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERLOAD7 | %FileCheck %s -check-prefix=OVERLOAD6
+
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=HASERROR1 | %FileCheck %s -check-prefix=HASERROR1
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=HASERROR2 | %FileCheck %s -check-prefix=HASERROR2
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=HASERROR3 | %FileCheck %s -check-prefix=HASERROR3
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=HASERROR4 | %FileCheck %s -check-prefix=HASERROR4
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=MEMBER1 | %FileCheck %s -check-prefix=MEMBER1
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=MEMBER2 | %FileCheck %s -check-prefix=MEMBER2
@@ -215,12 +223,24 @@
func f2() {
foo2(C2I, #^OVERLOAD2^#)
}
- func f2() {
+ func f3() {
foo2(C1I, b1: #^OVERLOAD3^#)
}
- func f2() {
+ func f4() {
foo2(C2I, b2: #^OVERLOAD4^#)
}
+
+ func f5() {
+ foo2(#^OVERLOAD5^#
+ }
+
+ func overloaded(_ a1: C1, b1: C2) {}
+ func overloaded(a2: C2, b2: C1) {}
+
+ func f6(obj: C3) {
+ overloaded(#^OVERLOAD6^#
+ obj.overloaded(#^OVERLOAD7^#
+ }
}
// OVERLOAD1: Begin completions, 1 items
@@ -251,6 +271,49 @@
// FIXME: This should be a negative test case
// NEGATIVE_OVERLOAD4-NOT: Decl[Class]{{.*}} C2
+// OVERLOAD5: Begin completions
+// OVERLOAD5-DAG: Pattern/CurrModule: ['(']{#(a): C1#}, {#b1: C2#}[')'][#Void#]; name=a: C1, b1: C2
+// OVERLOAD5-DAG: Pattern/CurrModule: ['(']{#(a): C2#}, {#b2: C1#}[')'][#Void#]; name=a: C2, b2: C1
+// OVERLOAD5-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Identical]: C1I[#C1#]; name=C1I
+// OVERLOAD5-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Identical]: C2I[#C2#]; name=C2I
+// OVERLOAD5: End completions
+
+// OVERLOAD6: Begin completions
+// OVERLOAD6-DAG: Pattern/CurrModule: ['(']{#(a1): C1#}, {#b1: C2#}[')'][#Void#]; name=a1: C1, b1: C2
+// OVERLOAD6-DAG: Pattern/CurrModule: ['(']{#a2: C2#}, {#b2: C1#}[')'][#Void#]; name=a2: C2, b2: C1
+// OVERLOAD6-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Identical]: C1I[#C1#]; name=C1I
+// OVERLOAD6-DAG: Decl[InstanceVar]/CurrNominal: C2I[#C2#]; name=C2I
+// OVERLOAD6: End completions
+
+extension C3 {
+ func hasError(a1: C1, b1: TypeInvalid) -> Int {}
+
+ func f7(obj: C3) {
+ let _ = obj.hasError(#^HASERROR1^#
+ let _ = obj.hasError(a1: #^HASERROR2^#
+ let _ = obj.hasError(a1: IC1, #^HASERROR3^#
+ let _ = obj.hasError(a1: IC1, b1: #^HASERROR4^#
+ }
+}
+
+// HASERROR1: Begin completions
+// HASERROR1-DAG: Pattern/CurrModule: ['(']{#a1: C1#}, {#b1: <<error type>>#}[')'][#Int#];
+// HASERROR1: End completions
+
+// HASERROR2: Begin completions
+// HASERROR2-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Identical]: C1I[#C1#];
+// HASERROR2-DAG: Decl[InstanceVar]/CurrNominal: C2I[#C2#];
+// HASERROR2: End completions
+
+// HASERROR3: Begin completions
+// HASERROR3-DAG: Keyword/ExprSpecific: b1: [#Argument name#];
+// HASERROR3: End completions
+
+// HASERROR4: Begin completions
+// HASERROR4-DAG: Decl[InstanceVar]/CurrNominal: C1I[#C1#];
+// HASERROR4-DAG: Decl[InstanceVar]/CurrNominal: C2I[#C2#];
+// HASERROR4: End completions
+
class C4 {
func f1(_ G : Gen) {
foo(1, b1: G.#^MEMBER1^#
diff --git a/test/IDE/complete_decl_attribute.swift b/test/IDE/complete_decl_attribute.swift
index b8e093f..ca51339 100644
--- a/test/IDE/complete_decl_attribute.swift
+++ b/test/IDE/complete_decl_attribute.swift
@@ -2,6 +2,7 @@
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABILITY2 | %FileCheck %s -check-prefix=AVAILABILITY2
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD2 | %FileCheck %s -check-prefix=KEYWORD2
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD3 | %FileCheck %s -check-prefix=KEYWORD3
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD3_2 | %FileCheck %s -check-prefix=KEYWORD3
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD4 | %FileCheck %s -check-prefix=KEYWORD4
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD5 | %FileCheck %s -check-prefix=KEYWORD5
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD_LAST | %FileCheck %s -check-prefix=KEYWORD_LAST
@@ -63,6 +64,10 @@
// KEYWORD3-NEXT: Keyword/None: usableFromInline[#Class Attribute#]; name=usableFromInline
// KEYWORD3-NEXT: End completions
+@#^KEYWORD3_2^#IB
+class C2 {}
+// Same as KEYWORD3.
+
@#^KEYWORD4^#
enum E {}
// KEYWORD4: Begin completions, 5 items
diff --git a/test/IDE/complete_expr_postfix_begin.swift b/test/IDE/complete_expr_postfix_begin.swift
index d84711f..d1fef81 100644
--- a/test/IDE/complete_expr_postfix_begin.swift
+++ b/test/IDE/complete_expr_postfix_begin.swift
@@ -75,6 +75,14 @@
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TUPLE_1 | %FileCheck %s -check-prefix=IN_TUPLE_1
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IN_TUPLE_2 | %FileCheck %s -check-prefix=IN_TUPLE_2
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_1 | %FileCheck %s -check-prefix=OWN_INIT_1
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_2 | %FileCheck %s -check-prefix=OWN_INIT_2
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_3 | %FileCheck %s -check-prefix=OWN_INIT_3
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_4 | %FileCheck %s -check-prefix=OWN_INIT_4
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_5 | %FileCheck %s -check-prefix=OWN_INIT_5
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_6 | %FileCheck %s -check-prefix=OWN_INIT_6
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OWN_INIT_7 | %FileCheck %s -check-prefix=OWN_INIT_7
+
//
// Test code completion at the beginning of expr-postfix.
//
@@ -435,8 +443,7 @@
let after = 4
// IN_FOR_EACH_1-NOT: Decl[LocalVar]
// IN_FOR_EACH_1: Decl[LocalVar]/Local: local[#Int#];
-// FIXME: shouldn't show 'after' here.
-// IN_FOR_EACH_1: Decl[LocalVar]/Local: after[#Int#];
+// IN_FOR_EACH_1-NOT: after
// IN_FOR_EACH_1: Decl[LocalVar]/Local: arg[#Int#];
// IN_FOR_EACH_1-NOT: Decl[LocalVar]
}
@@ -448,8 +455,7 @@
let after = 4
// IN_FOR_EACH_2-NOT: Decl[LocalVar]
// IN_FOR_EACH_2: Decl[LocalVar]/Local/TypeRelation[Identical]: local[#Int#];
-// FIXME: shouldn't show 'after' here.
-// IN_FOR_EACH_2: Decl[LocalVar]/Local/TypeRelation[Identical]: after[#Int#];
+// IN_FOR_EACH_2-NOT: after
// IN_FOR_EACH_2: Decl[LocalVar]/Local/TypeRelation[Identical]: arg[#Int#];
// IN_FOR_EACH_2-NOT: Decl[LocalVar]
}
@@ -463,8 +469,7 @@
// IN_FOR_EACH_3: Decl[LocalVar]/Local: index[#Int#];
// IN_FOR_EACH_3-NOT: Decl[LocalVar]
// IN_FOR_EACH_3: Decl[LocalVar]/Local: local[#Int#];
-// FIXME: shouldn't show 'after' here.
-// IN_FOR_EACH_3: Decl[LocalVar]/Local: after[#Int#];
+// IN_FOR_EACH_3-NOT: after
// IN_FOR_EACH_3: Decl[LocalVar]/Local: arg[#Int#];
// IN_FOR_EACH_3-NOT: Decl[LocalVar]
}
@@ -503,8 +508,7 @@
// NOTE: [Convertible] to AnyHashable.
// IN_FOR_EACH_4-NOT: Decl[LocalVar]
// IN_FOR_EACH_4: Decl[LocalVar]/Local/TypeRelation[Convertible]: local[#Int#];
-// FIXME: shouldn't show 'after' here.
-// IN_FOR_EACH_4: Decl[LocalVar]/Local/TypeRelation[Convertible]: after[#Int#];
+// IN_FOR_EACH_4-NOT: after
// IN_FOR_EACH_4: Decl[LocalVar]/Local/TypeRelation[Convertible]: arg[#Int#];
// IN_FOR_EACH_4-NOT: Decl[LocalVar]
}
@@ -555,3 +559,31 @@
// IN_TUPLE_2: Decl[LocalVar]/Local: localStr[#String#]; name=localStr
// IN_TUPLE_2: Decl[LocalVar]/Local/TypeRelation[Identical]: localInt[#Int#]; name=localInt
// IN_TUPLE_2: End completions
+
+var ownInit1: Int = #^OWN_INIT_1^#
+// OWN_INIT_1: Begin completions
+// OWN_INIT_1-NOT: ownInit1
+var ownInit2: () -> Void = { #^OWN_INIT_2^# }
+// OWN_INIT_2: Begin completions
+// OWN_INIT_2-NOT: ownInit2
+struct OwnInitTester {
+ var ownInit3: Int = #^OWN_INIT_3^#
+ // OWN_INIT_3: Begin completions
+ // OWN_INIT_3-NOT: ownInit3
+ var ownInit4: () -> Void = { #^OWN_INIT_4^# }
+ // OWN_INIT_4: Begin completions
+ // OWN_INIT_4-NOT: ownInit4
+}
+func ownInitTesting() {
+ var ownInit5: Int = #^OWN_INIT_5^#
+ // OWN_INIT_5: Begin completions
+ // OWN_INIT_5-NOT: ownInit5
+ var ownInit6: () -> Void = { #^OWN_INIT_6^# }
+ // OWN_INIT_6: Begin completions
+ // OWN_INIT_6-NOT: ownInit6
+}
+func ownInitTestingShadow(ownInit7: Int) {
+ var ownInit7: Int = #^OWN_INIT_7^#
+ // OWN_INIT_7: Begin completions
+ // OWN_INIT_7: Decl[LocalVar]/Local/TypeRelation[Identical]: ownInit7[#Int#];
+}
diff --git a/test/IDE/complete_from_stdlib.swift b/test/IDE/complete_from_stdlib.swift
index daf976d..b7aad66 100644
--- a/test/IDE/complete_from_stdlib.swift
+++ b/test/IDE/complete_from_stdlib.swift
@@ -282,7 +282,7 @@
}
// INFIX_EXT_STRING: Begin completions
// INFIX_EXT_STRING-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: + {#String#}[#String#]
-// INFIX_EXT_STRING-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: == {#Bool#}[#Bool#]
// INFIX_EXT_STRING-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: || {#Bool#}[#Bool#]
// INFIX_EXT_STRING-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: && {#Bool#}[#Bool#]
+// INFIX_EXT_STRING-NOT: ==
// INFIX_EXT_STRING: End completions
diff --git a/test/IDE/complete_operators.swift b/test/IDE/complete_operators.swift
index 2e54a61..5b53fb8 100644
--- a/test/IDE/complete_operators.swift
+++ b/test/IDE/complete_operators.swift
@@ -145,15 +145,20 @@
// ===--- Infix operators
+precedencegroup S2PrecedenceGroup {
+ associativity: left
+ lowerThan: ComparisonPrecedence
+ higherThan: AssignmentPrecedence
+}
+precedencegroup S2AssignmentPrecedenceGroup {
+ associativity: none
+ lowerThan: ComparisonPrecedence
+ higherThan: AssignmentPrecedence
+}
+
struct S2 {}
-infix operator ** {
- associativity left
- precedence 123
-}
-infix operator **= {
- associativity none
- precedence 123
-}
+infix operator ** : S2PrecedenceGroup
+infix operator **= : S2AssignmentPrecedenceGroup
func +(x: S2, y: S2) -> S2 { return x }
func **(x: S2, y: Int) -> S2 { return x }
func **=(x: inout S2, y: Int) -> Void { return x }
@@ -364,13 +369,13 @@
x + x == x + x#^EXT_INFIX_2^#
}
// S4_EXT_INFIX: Begin completions
-// S4_EXT_INFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: != {#Bool#}[#Bool#]
// S4_EXT_INFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: + {#S4#}[#S4#]
-// S4_EXT_INFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: == {#Bool#}[#Bool#]
// S4_EXT_INFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: && {#Bool#}[#Bool#]
// S4_EXT_INFIX-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: || {#Bool#}[#Bool#]
// S4_EXT_INFIX: End completions
+// S4_EXT_INFIX-NEG-NOT: !=
+// S4_EXT_INFIX-NEG-NOT: ==
// S4_EXT_INFIX_NEG-NOT: +++
// S4_EXT_INFIX_NEG-NOT: &&&
@@ -425,4 +430,4 @@
// INFIX_AUTOCLOSURE_1-DAG: Decl[InfixOperatorFunction]/CurrModule: [' ']&&&& {#Boolish#}[#Boolish#];
// INFIX_AUTOCLOSURE_1-DAG: Decl[InfixOperatorFunction]/CurrModule: [' ']==== {#Boolish#}[#Boolish#];
// INFIX_AUTOCLOSURE_1-DAG: Decl[InfixOperatorFunction]/CurrModule: [' ']|||| {#Boolish#}[#Boolish#];
-// INFIX_AUTOCLOSURE_1: End completions
\ No newline at end of file
+// INFIX_AUTOCLOSURE_1: End completions
diff --git a/test/IDE/complete_type.swift b/test/IDE/complete_type.swift
index b1f3aaa..ce22a39 100644
--- a/test/IDE/complete_type.swift
+++ b/test/IDE/complete_type.swift
@@ -362,13 +362,13 @@
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.types.txt
-// FIXME: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPE_IDENTIFIER_GENERIC_1 > %t.types.txt
-// FIXME: %FileCheck %s -check-prefix=TYPE_IDENTIFIER_GENERIC_1 < %t.types.txt
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPE_IDENTIFIER_GENERIC_1 > %t.types.txt
+// RUN: %FileCheck %s -check-prefix=TYPE_IDENTIFIER_GENERIC_1 < %t.types.txt
// RUN: %FileCheck %s -check-prefix=WITHOUT_GLOBAL_TYPES < %t.types.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.types.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPE_IDENTIFIER_GENERIC_2 > %t.types.txt
-// FIXME: %FileCheck %s -check-prefix=TYPE_IDENTIFIER_GENERIC_2 < %t.types.txt
+// RUN: %FileCheck %s -check-prefix=TYPE_IDENTIFIER_GENERIC_2 < %t.types.txt
// RUN: %FileCheck %s -check-prefix=WITHOUT_GLOBAL_TYPES < %t.types.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.types.txt
@@ -386,6 +386,16 @@
// RUN: %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES < %t.gentypealias.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.gentypealias.txt
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_TOPLEVEL_VAR | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_TOPLEVEL_PARAM | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_TOPLEVEL_RETURN | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_MEMBER_VAR | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_MEMBER_PARAM | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_MEMBER_RETURN | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_LOCAL_VAR | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_LOCAL_PARAM | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES
+// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_ARGS_LOCAL_RETURN | %FileCheck %s -check-prefix=WITH_GLOBAL_TYPES
+
//===--- Helper types that are used in this test
struct FooStruct {
@@ -1003,9 +1013,8 @@
>(a: GenericFoo.#^TYPE_IDENTIFIER_GENERIC_1^#
// TYPE_IDENTIFIER_GENERIC_1: Begin completions
-// TYPE_IDENTIFIER_GENERIC_1-NEXT: Decl[TypeAlias]/Super: FooTypeAlias1{{; name=.+$}}
+// TYPE_IDENTIFIER_GENERIC_1-NEXT: Decl[AssociatedType]/Super: FooTypeAlias1{{; name=.+$}}
// TYPE_IDENTIFIER_GENERIC_1-NEXT: Keyword/None: Type[#GenericFoo.Type#]
-// TYPE_IDENTIFIER_GENERIC_1-NEXT: Keyword/None: self[#GenericFoo#]
// TYPE_IDENTIFIER_GENERIC_1-NEXT: End completions
func testTypeIdentifierGeneric2<
@@ -1013,10 +1022,9 @@
>(a: GenericFoo.#^TYPE_IDENTIFIER_GENERIC_2^#
// TYPE_IDENTIFIER_GENERIC_2: Begin completions
-// TYPE_IDENTIFIER_GENERIC_2-NEXT: Decl[TypeAlias]/Super: BarTypeAlias1{{; name=.+$}}
-// TYPE_IDENTIFIER_GENERIC_2-NEXT: Decl[TypeAlias]/Super: FooTypeAlias1{{; name=.+$}}
+// TYPE_IDENTIFIER_GENERIC_2-NEXT: Decl[AssociatedType]/Super: BarTypeAlias1{{; name=.+$}}
+// TYPE_IDENTIFIER_GENERIC_2-NEXT: Decl[AssociatedType]/Super: FooTypeAlias1{{; name=.+$}}
// TYPE_IDENTIFIER_GENERIC_2-NEXT: Keyword/None: Type[#GenericFoo.Type#]
-// TYPE_IDENTIFIER_GENERIC_2-NEXT: Keyword/None: self[#GenericFoo#]
// TYPE_IDENTIFIER_GENERIC_2-NEXT: End completions
func testTypeIdentifierGeneric3<
@@ -1058,3 +1066,19 @@
typealias MyPair<T> = (T, T)
let x: MyPair<#^GENERIC_TYPEALIAS_2^#>
}
+
+// In generic argument
+struct GenStruct<T> { }
+let a : GenStruct<#^GENERIC_ARGS_TOPLEVEL_VAR^#
+func foo1(x: GenStruct<#^GENERIC_ARGS_TOPLEVEL_PARAM^#
+func foo2() -> GenStruct<#^GENERIC_ARGS_TOPLEVEL_RETURN^#
+class _TestForGenericArg_ {
+ let a : GenStruct<#^GENERIC_ARGS_MEMBER_VAR^#
+ func foo1(x: GenStruct<#^GENERIC_ARGS_MEMBER_PARAM^#
+ func foo2() -> GenStruct<#^GENERIC_ARGS_MEMBER_RETURN^#
+}
+func _testForGenericArg_() {
+ let a : GenStruct<#^GENERIC_ARGS_LOCAL_VAR^#
+ func foo1(x: GenStruct<#^GENERIC_ARGS_LOCAL_PARAM^#
+ func foo2() -> GenStruct<#^GENERIC_ARGS_LOCAL_RETURN^#
+}
diff --git a/test/IDE/print_ast_tc_decls.swift b/test/IDE/print_ast_tc_decls.swift
index a21a42b..75a2158 100644
--- a/test/IDE/print_ast_tc_decls.swift
+++ b/test/IDE/print_ast_tc_decls.swift
@@ -1358,7 +1358,7 @@
// FIXME: this same type requirement with Self should be printed here
associatedtype A2 : QuxProtocol where A2.Qux == Self
-// PREFER_TYPE_REPR_PRINTING-DAG: {{^}} associatedtype A2 : QuxProtocol where Self.A2.Qux == Self{{$}}
+// PREFER_TYPE_REPR_PRINTING-DAG: {{^}} associatedtype A2 : QuxProtocol where Self == Self.A2.Qux{{$}}
}
#if true
diff --git a/test/IDE/print_synthesized_extensions.swift b/test/IDE/print_synthesized_extensions.swift
index e0deb86..2cfc033 100644
--- a/test/IDE/print_synthesized_extensions.swift
+++ b/test/IDE/print_synthesized_extensions.swift
@@ -237,21 +237,21 @@
public func foo1() {}
}
-// CHECK1: <synthesized>extension <ref:Struct>S1</ref> where T : <ref:Protocol>P2</ref> {
+// CHECK1: <synthesized>extension <ref:Struct>S1</ref> where <ref:GenericTypeParam>Self</ref>.P2T1 : <ref:Protocol>P2</ref> {
// CHECK1-NEXT: <decl:Func>public func <loc>p2member()</loc></decl>
// CHECK1-NEXT: <decl:Func>public func <loc>ef1(<decl:Param>t: T</decl>)</loc></decl>
// CHECK1-NEXT: <decl:Func>public func <loc>ef2(<decl:Param>t: <ref:Struct>S2</ref></decl>)</loc></decl>
// CHECK1-NEXT: }</synthesized>
-// CHECK2: <synthesized>extension <ref:Struct>S1</ref> where T : <ref:Protocol>P3</ref> {
+// CHECK2: <synthesized>extension <ref:Struct>S1</ref> where <ref:GenericTypeParam>Self</ref>.T1 : <ref:Protocol>P3</ref> {
// CHECK2-NEXT: <decl:Func>public func <loc>p3Func(<decl:Param>i: <ref:Struct>Int</ref></decl>)</loc> -> <ref:Struct>Int</ref></decl>
// CHECK2-NEXT: }</synthesized>
-// CHECK3: <synthesized>extension <ref:Struct>S1</ref> where T == <ref:Struct>Int</ref> {
+// CHECK3: <synthesized>extension <ref:Struct>S1</ref> where <ref:GenericTypeParam>Self</ref>.T1 == <ref:Struct>Int</ref> {
// CHECK3-NEXT: <decl:Func>public func <loc>p1IntFunc(<decl:Param>i: <ref:Struct>Int</ref></decl>)</loc> -> <ref:Struct>Int</ref></decl>
// CHECK3-NEXT: }</synthesized>
-// CHECK4: <synthesized>extension <ref:Struct>S1</ref> where T == <ref:Struct>S9</ref><<ref:Struct>Int</ref>> {
+// CHECK4: <synthesized>extension <ref:Struct>S1</ref> where <ref:GenericTypeParam>Self</ref>.T1 == <ref:Struct>S9</ref><<ref:Struct>Int</ref>> {
// CHECK4-NEXT: <decl:Func>public func <loc>S9IntFunc()</loc></decl>
// CHECK4-NEXT: }</synthesized>
diff --git a/test/IRGen/bridge_object_arm64.sil b/test/IRGen/bridge_object_arm64.sil
index 053cee1..3642d70 100644
--- a/test/IRGen/bridge_object_arm64.sil
+++ b/test/IRGen/bridge_object_arm64.sil
@@ -35,8 +35,8 @@
// CHECK: [[TAGGED_RESULT:%.*]] = bitcast [[BRIDGE]] %0 to [[C:%objc_object\*]]
// CHECK: br label %tagged-cont
// CHECK: not-tagged-pointer:
-// -- 0x00ff_ffff_ffff_fff8
-// CHECK: [[MASKED_BITS:%.*]] = and i64 [[BOBITS]], 72057594037927928
+// -- 0x0fff_ffff_ffff_fff8
+// CHECK: [[MASKED_BITS:%.*]] = and i64 [[BOBITS]], 1152921504606846968
// CHECK: [[MASKED_RESULT:%.*]] = inttoptr i64 [[MASKED_BITS]] to [[C]]
// CHECK: br label %tagged-cont
// CHECK: tagged-cont:
diff --git a/test/IRGen/class_bounded_generics.swift b/test/IRGen/class_bounded_generics.swift
index 3e884c4..642bc8b 100644
--- a/test/IRGen/class_bounded_generics.swift
+++ b/test/IRGen/class_bounded_generics.swift
@@ -285,8 +285,8 @@
// CHECK: [[ISA_ADDR:%.*]] = bitcast %T22class_bounded_generics1AC.1* %0 to %swift.type**
// CHECK-NEXT: [[ISA:%.*]] = load %swift.type*, %swift.type** [[ISA_ADDR]]
// CHECK: call swiftcc void @"$s22class_bounded_generics14takes_metatypeyyxmlF"(%swift.type* %T, %swift.type* %T)
-// CHECK-NEXT: [[ISA_PTR:%.*]] = bitcast %swift.type* [[ISA]] to %swift.type**
-// CHECK-NEXT: [[U_ADDR:%.*]] = getelementptr inbounds %swift.type*, %swift.type** [[ISA_PTR]], i64 10
+// CHECK-NEXT: [[T:%.*]] = bitcast %swift.type* %T to %swift.type**
+// CHECK-NEXT: [[U_ADDR:%.*]] = getelementptr inbounds %swift.type*, %swift.type** [[T]], i64 10
// CHECK-NEXT: [[U:%.*]] = load %swift.type*, %swift.type** [[U_ADDR]]
// CHECK: call swiftcc void @"$s22class_bounded_generics14takes_metatypeyyxmlF"(%swift.type* %U, %swift.type* %U)
// CHECK: ret void
diff --git a/test/IRGen/error_self_conformance.sil b/test/IRGen/error_self_conformance.sil
new file mode 100644
index 0000000..8024181
--- /dev/null
+++ b/test/IRGen/error_self_conformance.sil
@@ -0,0 +1,19 @@
+// RUN: %target-swift-frontend -assume-parsing-unqualified-ownership-sil -emit-ir %s | %FileCheck %s -DINT=i%target-ptrsize
+
+import Swift
+
+sil @take_any_error : $@convention(thin) <T: Error> (@in T) -> ()
+
+// CHECK-LABEL: swiftcc void @test(%swift.error**
+sil @test : $@convention(thin) (@in Error) -> () {
+entry(%0 : $*Error):
+ // CHECK: [[VALUE:%.*]] = bitcast %swift.error** %0 to %swift.opaque*
+ // CHECK-NEXT: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$ss5Error_pMa"([[INT]] 0)
+ // CHECK-NEXT: [[ERROR_METADATA:%.*]] = extractvalue %swift.metadata_response [[T0]], 0
+ // CHECK-NEXT: call swiftcc void @take_any_error(%swift.opaque* noalias nocapture [[VALUE]], %swift.type* [[ERROR_METADATA]], i8** @"$ss5ErrorWS")
+ // CHECK-NEXT: ret void
+ %take = function_ref @take_any_error : $@convention(thin) <T: Error> (@in T) -> ()
+ apply %take<Error>(%0) : $@convention(thin) <T: Error> (@in T) -> ()
+ %ret = tuple ()
+ return %ret : $()
+}
diff --git a/test/IRGen/extension_type_metadata_linking.swift b/test/IRGen/extension_type_metadata_linking.swift
index 894d23e..46099fd 100644
--- a/test/IRGen/extension_type_metadata_linking.swift
+++ b/test/IRGen/extension_type_metadata_linking.swift
@@ -21,6 +21,8 @@
// CHECK-LABEL: @"$sSo8NSNumberC31extension_type_metadata_linkingE6StructVMn" = constant
// CHECK-LABEL: @"$sSo8NSNumberC31extension_type_metadata_linkingE6StructVMf" = internal constant
+// CHECK-LABEL: "$sSo18NSComparisonResultVMn" = linkonce_odr hidden
+
// CHECK-LABEL: @"$sSo8NSNumberC31extension_type_metadata_linkingE4BaseCN" = alias
// CHECK-LABEL: @"$sSo8NSNumberC31extension_type_metadata_linkingE7DerivedCN" = alias
// CHECK-LABEL: @"$sSo8NSNumberC31extension_type_metadata_linkingE6StructVN" = alias
@@ -47,3 +49,22 @@
public struct Struct {}
}
+// SR-9397: not emitting metadata for NSComparisonResult
+protocol CommandTypes {
+ associatedtype Result
+ associatedtype Message
+}
+
+struct EnumCommand: CommandTypes {
+ typealias Result = ComparisonResult
+ typealias Message = String
+}
+
+struct Command<T: CommandTypes> {
+ var result: T.Result?
+ var message: T.Message?
+}
+
+func createCommandArray() -> Any {
+ return [Command<EnumCommand>]()
+}
diff --git a/test/IRGen/fulfillment.sil b/test/IRGen/fulfillment.sil
index fff4955..0a44fea 100644
--- a/test/IRGen/fulfillment.sil
+++ b/test/IRGen/fulfillment.sil
@@ -53,3 +53,33 @@
%2 = tuple ()
return %2 : $()
}
+
+protocol A2 {
+ associatedtype AssocTy
+}
+
+protocol C {
+}
+
+extension A2 where Self.AssocTy : C {
+}
+
+class K<T> : A2 where T : C {
+ typealias AssocTy = T
+}
+
+sil @callee : $@convention(method) <τ_0_0 where τ_0_0 : A2, τ_0_0.AssocTy : C> (@in_guaranteed τ_0_0) -> ()
+
+// CHECK-LABEL: define{{.*}} swiftcc void @caller(%T11fulfillment1KC** {{.*}}, %swift.type* %Self, i8** %SelfWitnessTable)
+// CHECK: entry:
+// CHECK: %1 = bitcast %swift.type* %Self to i8***
+// CHECK: %2 = getelementptr inbounds i8**, i8*** %1, i64 11
+// CHECK: %"\CF\84_1_0.C" = load i8**, i8*** %2
+// CHECK: call swiftcc void @callee(%swift.type* %Self, i8** %SelfWitnessTable, i8** %"\CF\84_1_0.C"
+sil @caller : $@convention(witness_method: A2) <τ_0_0><τ_1_0 where τ_0_0 : K<τ_1_0>, τ_1_0 : C> (@in_guaranteed τ_0_0) -> () {
+bb0(%0 : $*τ_0_0):
+ %1 = function_ref @callee : $@convention(method) <τ_0_0 where τ_0_0 : A2, τ_0_0.AssocTy : C> (@in_guaranteed τ_0_0) -> ()
+ %2 = apply %1<τ_0_0>(%0) : $@convention(method) <τ_0_0 where τ_0_0 : A2, τ_0_0.AssocTy : C> (@in_guaranteed τ_0_0) -> ()
+ %3 = tuple ()
+ return %3 : $()
+}
diff --git a/test/IRGen/multi_payload_shifting.swift b/test/IRGen/multi_payload_shifting.swift
new file mode 100644
index 0000000..44d9e0b
--- /dev/null
+++ b/test/IRGen/multi_payload_shifting.swift
@@ -0,0 +1,32 @@
+// RUN: %target-swift-frontend -enable-objc-interop -assume-parsing-unqualified-ownership-sil -primary-file %s -emit-ir | %FileCheck %s
+
+// REQUIRES: CPU=x86_64
+
+class Tag {}
+
+struct Scalar {
+ var str = ""
+ var x = Tag()
+ var style: BinaryChoice = .zero
+ enum BinaryChoice: UInt32 {
+ case zero = 0
+ case one
+ }
+}
+
+public struct Sequence {
+ var tag: Tag = Tag()
+ var tag2: Tag = Tag()
+}
+
+enum Node {
+ case scalar(Scalar)
+ case sequence(Sequence)
+}
+
+// CHECK: define internal i32 @"$s22multi_payload_shifting4NodeOwet"(%swift.opaque* noalias %value, i32 %numEmptyCases, %swift.type* %Node)
+// CHECK: [[ADDR:%.*]] = getelementptr inbounds { i64, i64, i64, i8 }, { i64, i64, i64, i8 }* {{.*}}, i32 0, i32 3
+// CHECK: [[BYTE:%.*]] = load i8, i8* [[ADDR]]
+// Make sure we zext before we shift.
+// CHECK: [[ZEXT:%.*]] = zext i8 [[BYTE]] to i32
+// CHECK: shl i32 [[ZEXT]], 10
diff --git a/test/Interpreter/SDK/objc_getClass.swift b/test/Interpreter/SDK/objc_getClass.swift
new file mode 100644
index 0000000..2156471
--- /dev/null
+++ b/test/Interpreter/SDK/objc_getClass.swift
@@ -0,0 +1,210 @@
+// RUN: %empty-directory(%t)
+
+// RUN: %target-build-swift-dylib(%t/libresilient_struct.%target-dylib-extension) -Xfrontend -enable-resilience -Xfrontend -enable-class-resilience %S/../../Inputs/resilient_struct.swift -emit-module -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct
+// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension
+
+// RUN: %target-build-swift-dylib(%t/libresilient_class.%target-dylib-extension) -Xfrontend -enable-resilience -Xfrontend -enable-class-resilience %S/../../Inputs/resilient_class.swift -emit-module -emit-module-path %t/resilient_class.swiftmodule -module-name resilient_class -I%t -L%t -lresilient_struct
+// RUN: %target-codesign %t/libresilient_class.%target-dylib-extension
+
+// RUN: %target-build-swift %s -L %t -I %t -lresilient_struct -lresilient_class -o %t/main -Xlinker -rpath -Xlinker %t
+// RUN: %target-codesign %t/main
+
+// RUN: %target-run %t/main %t/libresilient_struct.%target-dylib-extension %t/libresilient_class.%target-dylib-extension
+
+
+// REQUIRES: executable_test
+// REQUIRES: objc_interop
+
+// Test Swift's hook for objc_getClass()
+
+import StdlibUnittest
+import ObjectiveC
+import Foundation
+import resilient_struct
+import resilient_class
+
+// Old OS versions do not have this hook.
+let getClassHookMissing = {
+ nil == dlsym(UnsafeMutableRawPointer(bitPattern: -2),
+ "objc_setHook_getClass")
+}()
+
+var testSuite = TestSuite("objc_getClass")
+
+
+class SwiftSuperclass { }
+class SwiftSubclass : SwiftSuperclass { }
+
+class ObjCSuperclass : NSObject { }
+class ObjCSubclass : ObjCSuperclass { }
+
+
+class MangledSwiftSuperclass { }
+class MangledSwiftSubclass : MangledSwiftSuperclass { }
+
+class MangledObjCSuperclass : NSObject { }
+class MangledObjCSubclass : MangledObjCSuperclass { }
+
+
+class GenericSwiftClass<Value> {
+ let value: Value
+ init(value: Value) { self.value = value }
+}
+class ConstrainedSwiftSuperclass : GenericSwiftClass<String> {
+ init() { super.init(value:"") }
+}
+class ConstrainedSwiftSubclass : ConstrainedSwiftSuperclass { }
+
+
+class MangledGenericSwiftClass<Value> {
+ let value: Value
+ init(value: Value) { self.value = value }
+}
+class MangledConstrainedSwiftSuperclass : MangledGenericSwiftClass<String> {
+ init() { super.init(value:"") }
+}
+class MangledConstrainedSwiftSubclass : MangledConstrainedSwiftSuperclass { }
+
+
+class GenericObjCClass<Value> : NSObject {
+ let value: Value
+ init(value: Value) { self.value = value }
+}
+class ConstrainedObjCSuperclass : GenericObjCClass<String> {
+ init() { super.init(value:"") }
+}
+class ConstrainedObjCSubclass : ConstrainedObjCSuperclass { }
+
+
+class MangledGenericObjCClass<Value> : NSObject {
+ let value: Value
+ init(value: Value) { self.value = value }
+}
+class MangledConstrainedObjCSuperclass : MangledGenericObjCClass<String> {
+ init() { super.init(value:"") }
+}
+class MangledConstrainedObjCSubclass : MangledConstrainedObjCSuperclass { }
+
+
+class ResilientSuperclass : ResilientOutsideParent {
+ var supervalue = 10
+}
+
+class ResilientSubclass : ResilientSuperclass {
+ var subvalue = 20
+}
+
+
+class ResilientFieldSuperclassSwift {
+ var supervalue = ResilientInt(i: 1)
+}
+
+class ResilientFieldSubclassSwift : ResilientFieldSuperclassSwift {
+ var subvalue = ResilientInt(i: 2)
+}
+
+class ResilientFieldSuperclassObjC : NSObject {
+ var supervalue = ResilientInt(i: 3)
+}
+class ResilientFieldSubclassObjC : ResilientFieldSuperclassObjC {
+ var subvalue = ResilientInt(i: 4)
+}
+
+
+func requireClass(named name: String, demangledName: String) {
+ for _ in 1...2 {
+ let cls: AnyClass? = NSClassFromString(name)
+ expectNotNil(cls, "class named \(name) unexpectedly not found")
+ expectEqual(NSStringFromClass(cls!), demangledName,
+ "class named \(name) has the wrong name");
+ }
+}
+
+func requireClass(named name: String) {
+ return requireClass(named: name, demangledName: name)
+}
+
+testSuite.test("Basic") {
+ requireClass(named: "main.SwiftSubclass")
+ requireClass(named: "main.SwiftSuperclass")
+ requireClass(named: "main.ObjCSubclass")
+ requireClass(named: "main.ObjCSuperclass")
+}
+
+testSuite.test("BasicMangled") {
+ requireClass(named: "_TtC4main20MangledSwiftSubclass",
+ demangledName: "main.MangledSwiftSubclass")
+ requireClass(named: "_TtC4main22MangledSwiftSuperclass",
+ demangledName: "main.MangledSwiftSuperclass")
+ requireClass(named: "_TtC4main19MangledObjCSubclass",
+ demangledName: "main.MangledObjCSubclass")
+ requireClass(named: "_TtC4main21MangledObjCSuperclass",
+ demangledName: "main.MangledObjCSuperclass")
+}
+
+testSuite.test("Generic")
+ .skip(.custom({ getClassHookMissing },
+ reason: "objc_getClass hook not present"))
+ .code {
+ requireClass(named: "main.ConstrainedSwiftSubclass")
+ requireClass(named: "main.ConstrainedSwiftSuperclass")
+ requireClass(named: "main.ConstrainedObjCSubclass")
+ requireClass(named: "main.ConstrainedObjCSuperclass")
+}
+
+testSuite.test("GenericMangled")
+ .skip(.custom({ getClassHookMissing },
+ reason: "objc_getClass hook not present"))
+ .code {
+ requireClass(named: "_TtC4main24ConstrainedSwiftSubclass",
+ demangledName: "main.ConstrainedSwiftSubclass")
+ requireClass(named: "_TtC4main26ConstrainedSwiftSuperclass",
+ demangledName: "main.ConstrainedSwiftSuperclass")
+ requireClass(named: "_TtC4main23ConstrainedObjCSubclass",
+ demangledName: "main.ConstrainedObjCSubclass")
+ requireClass(named: "_TtC4main25ConstrainedObjCSuperclass",
+ demangledName: "main.ConstrainedObjCSuperclass")
+}
+
+testSuite.test("ResilientSubclass")
+ .skip(.custom({ getClassHookMissing },
+ reason: "objc_getClass hook not present"))
+ .code {
+ requireClass(named: "main.ResilientSubclass")
+ requireClass(named: "main.ResilientSuperclass")
+
+ expectEqual(ResilientSuperclass().supervalue, 10)
+ expectEqual(ResilientSubclass().supervalue, 10)
+ expectEqual(ResilientSubclass().subvalue, 20)
+}
+
+testSuite.test("ResilientField")
+ .skip(.custom({ getClassHookMissing },
+ reason: "objc_getClass hook not present"))
+ .code {
+ requireClass(named: "main.ResilientFieldSubclassSwift")
+ requireClass(named: "main.ResilientFieldSuperclassSwift")
+ requireClass(named: "main.ResilientFieldSubclassObjC")
+ requireClass(named: "main.ResilientFieldSuperclassObjC")
+
+ expectEqual(ResilientFieldSuperclassSwift().supervalue.i, 1)
+ expectEqual(ResilientFieldSubclassSwift().supervalue.i, 1)
+ expectEqual(ResilientFieldSubclassSwift().subvalue.i, 2)
+ expectEqual(ResilientFieldSuperclassObjC().supervalue.i, 3)
+ expectEqual(ResilientFieldSubclassObjC().supervalue.i, 3)
+ expectEqual(ResilientFieldSubclassObjC().subvalue.i, 4)
+}
+
+testSuite.test("NotPresent") {
+ // This class does not exist.
+ expectNil(NSClassFromString("main.ThisClassDoesNotExist"));
+
+ // This name is improperly mangled
+ expectNil(NSClassFromString("_TtC5main"));
+
+ // Swift.Int is not a class type.
+ expectNil(NSClassFromString("Si"))
+}
+
+runAllTests()
+
diff --git a/test/Interpreter/error_self_conformance.swift b/test/Interpreter/error_self_conformance.swift
new file mode 100644
index 0000000..73b4268
--- /dev/null
+++ b/test/Interpreter/error_self_conformance.swift
@@ -0,0 +1,75 @@
+// RUN: %target-run-simple-swift | %FileCheck %s
+// REQUIRES: executable_test
+
+struct BoxedError<T: Error> {
+ var contents: T
+}
+
+enum MyError: Error {
+ case nothingImportant
+ case reallyImportant(String)
+}
+
+// CHECK: start
+print("start")
+
+let value = MyError.reallyImportant("hello")
+
+// CHECK-NEXT: reallyImportant("hello")
+print(value)
+
+func takeBoxedError<T>(error: BoxedError<T>) -> Error {
+ return error.contents
+}
+
+func makeBoxedError<T: Error>(error: T) -> BoxedError<Error> {
+ return BoxedError(contents: error)
+}
+
+let unboxedValue = takeBoxedError(error: makeBoxedError(error: value))
+
+// CHECK-NEXT: reallyImportant("hello")
+print(unboxedValue)
+
+let errorValue: Error = MyError.reallyImportant("goodbye")
+
+func castValueToError<T>(error: T) -> Error? {
+ return error as? Error
+}
+
+// CHECK-NEXT: reallyImportant("goodbye")
+print(castValueToError(error: errorValue) ?? value)
+
+struct Carrier<T> {
+ var name: String
+}
+protocol ErrorCarrier {}
+extension Carrier: ErrorCarrier where T: Error {}
+
+func castValueToErrorCarrier<T>(_ value: T) -> ErrorCarrier? {
+ return value as? ErrorCarrier
+}
+
+// CHECK-NEXT: nil
+print(castValueToErrorCarrier(Carrier<Int>(name: "A carrier of numbers")))
+
+// CHECK-NEXT: A carrier of my errors
+print(castValueToErrorCarrier(Carrier<MyError>(name: "A carrier of my errors")))
+
+// CHECK-NEXT: A carrier of all errors
+print(castValueToErrorCarrier(Carrier<Error>(name: "A carrier of all errors")))
+
+// CHECK-NEXT: nil
+protocol ErrorRefinement : Error {}
+print(castValueToErrorCarrier(Carrier<ErrorRefinement>(name: "A carrier of refined errors")))
+
+// CHECK-NEXT: nil
+protocol OtherProtocol {}
+print(castValueToErrorCarrier(Carrier<Error & OtherProtocol>(name: "A carrier of composed errors")))
+
+// CHECK-NEXT: nil
+class C {}
+print(castValueToErrorCarrier(Carrier<Error & C>(name: "A carrier of classic composed errors")))
+
+// CHECK-NEXT: end
+print("end")
diff --git a/test/Interpreter/multi_payload_extra_inhabitant.swift b/test/Interpreter/multi_payload_extra_inhabitant.swift
index 1a6ec59..71f1494 100644
--- a/test/Interpreter/multi_payload_extra_inhabitant.swift
+++ b/test/Interpreter/multi_payload_extra_inhabitant.swift
@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
-// RUN: %target-build-swift -parse-stdlib -Xfrontend -verify-type-layout -Xfrontend SpareBitExtraInhabitants -Xfrontend -verify-type-layout -Xfrontend SpareBitSingleExtraInhabitant -Xfrontend -verify-type-layout -Xfrontend SpareBitNoExtraInhabitant -Xfrontend -verify-type-layout -Xfrontend SpareBitNoExtraInhabitant2 -Xfrontend -verify-type-layout -Xfrontend TwoTagExtraInhabitants -Xfrontend -verify-type-layout -Xfrontend ThreeTagExtraInhabitants -Xfrontend -verify-type-layout -Xfrontend NoTagExtraInhabitants -Xfrontend -verify-type-layout -Xfrontend DynamicExtraInhabitantsNever -Xfrontend -verify-type-layout -Xfrontend DynamicExtraInhabitantsZeroBytes -Xfrontend -verify-type-layout -Xfrontend DynamicExtraInhabitantsOneByte -Xfrontend -verify-type-layout -Xfrontend DynamicExtraInhabitantsTwoBytes -O -o %t/a.out %s
+// RUN: %target-build-swift -parse-stdlib -Xfrontend -verify-type-layout -Xfrontend SpareBitExtraInhabitants -Xfrontend -verify-type-layout -Xfrontend SpareBitSingleExtraInhabitant -Xfrontend -verify-type-layout -Xfrontend SpareBitNoExtraInhabitant -Xfrontend -verify-type-layout -Xfrontend SpareBitNoExtraInhabitant2 -Xfrontend -verify-type-layout -Xfrontend TwoTagExtraInhabitants -Xfrontend -verify-type-layout -Xfrontend ThreeTagExtraInhabitants -Xfrontend -verify-type-layout -Xfrontend NoTagExtraInhabitants -Xfrontend -verify-type-layout -Xfrontend DynamicExtraInhabitantsNever -Xfrontend -verify-type-layout -Xfrontend DynamicExtraInhabitantsZeroBytes -Xfrontend -verify-type-layout -Xfrontend DynamicExtraInhabitantsOneByte -Xfrontend -verify-type-layout -Xfrontend DynamicExtraInhabitantsTwoBytes -Xfrontend -verify-type-layout -Xfrontend MoreSpareBitsThanTagsExtraInhabitants -Xfrontend -verify-type-layout -Xfrontend OptOptMoreSpareBitsThanTagsExtraInhabitants -O -o %t/a.out %s
// RUN: %target-run %t/a.out 2>&1
// Type layout verifier is only compiled into the runtime in asserts builds.
@@ -50,6 +50,21 @@
case c(Builtin.Int32)
}
+enum MoreSpareBitsThanTagsExtraInhabitants {
+ case a(Builtin.Int29)
+ case b(Builtin.Int29)
+ case c(Builtin.Int29)
+ case d(Builtin.Int29)
+}
+typealias OptOptMoreSpareBitsThanTagsExtraInhabitants =
+ Optional<Optional<MoreSpareBitsThanTagsExtraInhabitants>>
+
+enum MoreSpareBitsThanTagsExtraInhabitants2 {
+ case a(Builtin.Int29)
+ case b(Builtin.Int29)
+ case c(Builtin.Int29)
+}
+
enum NoTagExtraInhabitants {
case aaa(Builtin.Int32), aab(Builtin.Int32), aac(Builtin.Int32), aad(Builtin.Int32), aae(Builtin.Int32), aaf(Builtin.Int32), aag(Builtin.Int32), aah(Builtin.Int32)
case aba(Builtin.Int32), abb(Builtin.Int32), abc(Builtin.Int32), abd(Builtin.Int32), abe(Builtin.Int32), abf(Builtin.Int32), abg(Builtin.Int32), abh(Builtin.Int32)
@@ -201,4 +216,37 @@
expectHasAtLeastTwoExtraInhabitants(DynamicExtraInhabitantsOneByte.self, nil: nil, someNil: .some(nil))
expectHasAtLeastTwoExtraInhabitants(DynamicExtraInhabitantsTwoBytes.self, nil: nil, someNil: .some(nil))
}
+tests.test("types with more spare bits than used by tags") {
+ expectHasAtLeastTwoExtraInhabitants(MoreSpareBitsThanTagsExtraInhabitants.self,
+ nil: nil, someNil: .some(nil))
+
+ for x in [MoreSpareBitsThanTagsExtraInhabitants.a(Builtin.zeroInitializer()),
+ MoreSpareBitsThanTagsExtraInhabitants.b(Builtin.zeroInitializer()),
+ MoreSpareBitsThanTagsExtraInhabitants.c(Builtin.zeroInitializer()),
+ MoreSpareBitsThanTagsExtraInhabitants.d(Builtin.zeroInitializer())]{
+ let opt = Optional(x)
+ expectNotNil(opt)
+ let opt2 = Optional(opt)
+ expectNotNil(opt2)
+ let opt3 = Optional(opt2)
+ expectNotNil(opt3)
+ let opt4 = Optional(opt3)
+ expectNotNil(opt4)
+ }
+
+ for x in [MoreSpareBitsThanTagsExtraInhabitants.a(Builtin.zeroInitializer()),
+ MoreSpareBitsThanTagsExtraInhabitants.b(Builtin.zeroInitializer()),
+ MoreSpareBitsThanTagsExtraInhabitants.c(Builtin.zeroInitializer())]{
+ let opt = Optional(x)
+ expectNotNil(opt)
+ let opt2 = Optional(opt)
+ expectNotNil(opt2)
+ let opt3 = Optional(opt2)
+ expectNotNil(opt3)
+ let opt4 = Optional(opt3)
+ expectNotNil(opt4)
+ let opt5 = Optional(opt4)
+ expectNotNil(opt5)
+ }
+}
runAllTests()
diff --git a/test/Interpreter/multi_payload_shifting.swift b/test/Interpreter/multi_payload_shifting.swift
new file mode 100644
index 0000000..71c9a34
--- /dev/null
+++ b/test/Interpreter/multi_payload_shifting.swift
@@ -0,0 +1,50 @@
+// RUN: %target-run-simple-swift
+
+// REQUIRES: executable_test
+
+import Swift
+import StdlibUnittest
+
+class Tag {}
+
+struct Scalar {
+ var str = ""
+ var x = Tag()
+ var style: BinaryChoice = .zero
+ enum BinaryChoice: UInt32 {
+ case zero = 0
+ case one
+ }
+}
+
+public struct Sequence {
+ var tag: Tag = Tag()
+ var tag2: Tag = Tag()
+}
+
+enum Node {
+ case scalar(Scalar)
+ case sequence(Sequence)
+}
+
+func createOptionalNodeNil<T>(_ t: T) -> T? {
+ return nil
+}
+
+func isNil<T>(_ t: T?) -> Bool {
+ return t == nil
+}
+
+var tests = TestSuite("extra inhabitants shifts")
+
+
+tests.test("test-shift-fix") {
+ let opt = createOptionalNodeNil(Node.scalar(Scalar()))
+ var res = false
+ if isNil(opt) {
+ res = true
+ }
+ expectEqual(true, res)
+}
+
+runAllTests()
diff --git a/test/Runtime/Inputs/synthesized_decl_uniqueness.swift b/test/Runtime/Inputs/synthesized_decl_uniqueness.swift
index 5157acc..3537e38 100644
--- a/test/Runtime/Inputs/synthesized_decl_uniqueness.swift
+++ b/test/Runtime/Inputs/synthesized_decl_uniqueness.swift
@@ -1,4 +1,5 @@
import CoreLocation
+import Foundation
public func getCLError() -> Any.Type {
return CLError.self
@@ -7,3 +8,7 @@
public func getCLErrorCode() -> Any.Type {
return CLError.Code.self
}
+
+public func getNotificationNameSet() -> Any.Type {
+ return Set<NSNotification.Name>.self
+}
diff --git a/test/Runtime/synthesized_decl_uniqueness.swift b/test/Runtime/synthesized_decl_uniqueness.swift
index 17e7422..471542a 100644
--- a/test/Runtime/synthesized_decl_uniqueness.swift
+++ b/test/Runtime/synthesized_decl_uniqueness.swift
@@ -17,6 +17,7 @@
tests.test("synthesized type identity across modules") {
expectEqual(A.getCLError(), B.getCLError())
expectEqual(A.getCLErrorCode(), B.getCLErrorCode())
+ expectEqual(A.getNotificationNameSet(), B.getNotificationNameSet())
}
runAllTests()
diff --git a/test/SILGen/lazy_global_access.swift b/test/SILGen/lazy_global_access.swift
index 836f34d..5f09180 100644
--- a/test/SILGen/lazy_global_access.swift
+++ b/test/SILGen/lazy_global_access.swift
@@ -22,3 +22,16 @@
return (globalProp, Fooo.staticProp)
}
+// rdar://46472759
+// We used to crash tying to double-emit the setter.
+struct Bar {
+ mutating func mutate() {}
+}
+func useGlobalBar() -> Bar {
+ globalBar = Bar()
+ globalBar.mutate()
+ return globalBar
+}
+private var globalBar = Bar() {
+ willSet {}
+}
diff --git a/test/SILOptimizer/sil_combine_protocol_conf.swift b/test/SILOptimizer/sil_combine_protocol_conf.swift
index 4d8102a..3b6db5c 100644
--- a/test/SILOptimizer/sil_combine_protocol_conf.swift
+++ b/test/SILOptimizer/sil_combine_protocol_conf.swift
@@ -113,55 +113,55 @@
self.s = s;
}
-// CHECK-LABEL: sil hidden [noinline] @$s25sil_combine_protocol_conf5OtherC11doWorkClassSiyF : $@convention(method) (@guaranteed Other) -> Int {
-// CHECK: bb0
-// CHECK: debug_value
-// CHECK: integer_literal
-// CHECK: [[R1:%.*]] = ref_element_addr %0 : $Other, #Other.z
-// CHECK: [[O1:%.*]] = open_existential_addr immutable_access [[R1]] : $*DerivedProtocol to $*@opened("{{.*}}") DerivedProtocol
-// CHECK: [[W1:%.*]] = witness_method $@opened("{{.*}}") DerivedProtocol, #DerivedProtocol.foo!1 : <Self where Self : DerivedProtocol> (Self) -> () -> Int, [[O1]] : $*@opened("{{.*}}") DerivedProtocol : $@convention(witness_method: DerivedProtocol) <τ_0_0 where τ_0_0 : DerivedProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: apply [[W1]]<@opened("{{.*}}") DerivedProtocol>([[O1]]) : $@convention(witness_method: DerivedProtocol) <τ_0_0 where τ_0_0 : DerivedProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: struct_extract
-// CHECK: integer_literal
-// CHECK: builtin
-// CHECK: tuple_extract
-// CHECK: tuple_extract
-// CHECK: cond_fail
-// CHECK: [[R2:%.*]] = ref_element_addr %0 : $Other, #Other.p
-// CHECK: [[O2:%.*]] = open_existential_addr immutable_access [[R2]] : $*PublicProtocol to $*@opened("{{.*}}") PublicProtocol
-// CHECK: [[W2:%.*]] = witness_method $@opened("{{.*}}") PublicProtocol, #PublicProtocol.foo!1 : <Self where Self : PublicProtocol> (Self) -> () -> Int, [[O2]] : $*@opened("{{.*}}") PublicProtocol : $@convention(witness_method: PublicProtocol) <τ_0_0 where τ_0_0 : PublicProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: apply [[W2]]<@opened("{{.*}}") PublicProtocol>([[O2]]) : $@convention(witness_method: PublicProtocol) <τ_0_0 where τ_0_0 : PublicProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: struct_extract
-// CHECK: builtin
-// CHECK: tuple_extract
-// CHECK: tuple_extract
-// CHECK: cond_fail
-// CHECK: integer_literal
-// CHECK: builtin
-// CHECK: tuple_extract
-// CHECK: tuple_extract
-// CHECK: cond_fail
-// CHECK: [[R3:%.*]] = ref_element_addr %0 : $Other, #Other.r
-// CHECK: [[O3:%.*]] = open_existential_addr immutable_access [[R3]] : $*GenericProtocol to $*@opened("{{.*}}") GenericProtocol
-// CHECK: [[W3:%.*]] = witness_method $@opened("{{.*}}") GenericProtocol, #GenericProtocol.foo!1 : <Self where Self : GenericProtocol> (Self) -> () -> Int, [[O3]] : $*@opened("{{.*}}") GenericProtocol : $@convention(witness_method: GenericProtocol) <τ_0_0 where τ_0_0 : GenericProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: apply [[W3]]<@opened("{{.*}}") GenericProtocol>([[O3]]) : $@convention(witness_method: GenericProtocol) <τ_0_0 where τ_0_0 : GenericProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: struct_extract
-// CHECK: builtin
-// CHECK: tuple_extract
-// CHECK: tuple_extract
-// CHECK: cond_fail
-// CHECK: [[R4:%.*]] = ref_element_addr %0 : $Other, #Other.s
-// CHECK: [[O4:%.*]] = open_existential_addr immutable_access %36 : $*MultipleConformanceProtocol to $*@opened("{{.*}}") MultipleConformanceProtocol
-// CHECK: [[W4:%.*]] = witness_method $@opened("{{.*}}") MultipleConformanceProtocol, #MultipleConformanceProtocol.foo!1 : <Self where Self : MultipleConformanceProtocol> (Self) -> () -> Int, %37 : $*@opened("{{.*}}") MultipleConformanceProtocol : $@convention(witness_method: MultipleConformanceProtocol) <τ_0_0 where τ_0_0 : MultipleConformanceProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: apply [[W4]]<@opened("{{.*}}") MultipleConformanceProtocol>(%37) : $@convention(witness_method: MultipleConformanceProtocol) <τ_0_0 where τ_0_0 : MultipleConformanceProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: struct_extract
-// CHECK: builtin
-// CHECK: tuple_extract
-// CHECK: tuple_extract
-// CHECK: cond_fail
-// CHECK: struct
-// CHECK: return
-// CHECK: } // end sil function '$s25sil_combine_protocol_conf5OtherC11doWorkClassSiyF'
+// DISABLE-CHECK-LABEL: sil hidden [noinline] @$s25sil_combine_protocol_conf5OtherC11doWorkClassSiyF : $@convention(method) (@guaranteed Other) -> Int {
+// DISABLE-CHECK: bb0
+// DISABLE-CHECK: debug_value
+// DISABLE-CHECK: integer_literal
+// DISABLE-CHECK: [[R1:%.*]] = ref_element_addr %0 : $Other, #Other.z
+// DISABLE-CHECK: [[O1:%.*]] = open_existential_addr immutable_access [[R1]] : $*DerivedProtocol to $*@opened("{{.*}}") DerivedProtocol
+// DISABLE-CHECK: [[W1:%.*]] = witness_method $@opened("{{.*}}") DerivedProtocol, #DerivedProtocol.foo!1 : <Self where Self : DerivedProtocol> (Self) -> () -> Int, [[O1]] : $*@opened("{{.*}}") DerivedProtocol : $@convention(witness_method: DerivedProtocol) <τ_0_0 where τ_0_0 : DerivedProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: apply [[W1]]<@opened("{{.*}}") DerivedProtocol>([[O1]]) : $@convention(witness_method: DerivedProtocol) <τ_0_0 where τ_0_0 : DerivedProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: struct_extract
+// DISABLE-CHECK: integer_literal
+// DISABLE-CHECK: builtin
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: cond_fail
+// DISABLE-CHECK: [[R2:%.*]] = ref_element_addr %0 : $Other, #Other.p
+// DISABLE-CHECK: [[O2:%.*]] = open_existential_addr immutable_access [[R2]] : $*PublicProtocol to $*@opened("{{.*}}") PublicProtocol
+// DISABLE-CHECK: [[W2:%.*]] = witness_method $@opened("{{.*}}") PublicProtocol, #PublicProtocol.foo!1 : <Self where Self : PublicProtocol> (Self) -> () -> Int, [[O2]] : $*@opened("{{.*}}") PublicProtocol : $@convention(witness_method: PublicProtocol) <τ_0_0 where τ_0_0 : PublicProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: apply [[W2]]<@opened("{{.*}}") PublicProtocol>([[O2]]) : $@convention(witness_method: PublicProtocol) <τ_0_0 where τ_0_0 : PublicProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: struct_extract
+// DISABLE-CHECK: builtin
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: cond_fail
+// DISABLE-CHECK: integer_literal
+// DISABLE-CHECK: builtin
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: cond_fail
+// DISABLE-CHECK: [[R3:%.*]] = ref_element_addr %0 : $Other, #Other.r
+// DISABLE-CHECK: [[O3:%.*]] = open_existential_addr immutable_access [[R3]] : $*GenericProtocol to $*@opened("{{.*}}") GenericProtocol
+// DISABLE-CHECK: [[W3:%.*]] = witness_method $@opened("{{.*}}") GenericProtocol, #GenericProtocol.foo!1 : <Self where Self : GenericProtocol> (Self) -> () -> Int, [[O3]] : $*@opened("{{.*}}") GenericProtocol : $@convention(witness_method: GenericProtocol) <τ_0_0 where τ_0_0 : GenericProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: apply [[W3]]<@opened("{{.*}}") GenericProtocol>([[O3]]) : $@convention(witness_method: GenericProtocol) <τ_0_0 where τ_0_0 : GenericProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: struct_extract
+// DISABLE-CHECK: builtin
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: cond_fail
+// DISABLE-CHECK: [[R4:%.*]] = ref_element_addr %0 : $Other, #Other.s
+// DISABLE-CHECK: [[O4:%.*]] = open_existential_addr immutable_access %36 : $*MultipleConformanceProtocol to $*@opened("{{.*}}") MultipleConformanceProtocol
+// DISABLE-CHECK: [[W4:%.*]] = witness_method $@opened("{{.*}}") MultipleConformanceProtocol, #MultipleConformanceProtocol.foo!1 : <Self where Self : MultipleConformanceProtocol> (Self) -> () -> Int, %37 : $*@opened("{{.*}}") MultipleConformanceProtocol : $@convention(witness_method: MultipleConformanceProtocol) <τ_0_0 where τ_0_0 : MultipleConformanceProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: apply [[W4]]<@opened("{{.*}}") MultipleConformanceProtocol>(%37) : $@convention(witness_method: MultipleConformanceProtocol) <τ_0_0 where τ_0_0 : MultipleConformanceProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: struct_extract
+// DISABLE-CHECK: builtin
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: cond_fail
+// DISABLE-CHECK: struct
+// DISABLE-CHECK: return
+// DISABLE-CHECK: } // end sil function '$s25sil_combine_protocol_conf5OtherC11doWorkClassSiyF'
@inline(never) func doWorkClass () ->Int {
return self.x.foo(x:self.x) // optimize
+ self.y.bar(x:self.y) // optimize
@@ -235,61 +235,61 @@
}
// CHECK-LABEL: sil hidden [noinline] @$s25sil_combine_protocol_conf10OtherClassC12doWorkStructSiyF : $@convention(method) (@guaranteed OtherClass) -> Int {
-// CHECK: bb0
-// CHECK: debug_value
-// CHECK: [[A1:%.*]] = alloc_stack $PropProtocol
-// CHECK: [[R1:%.*]] = ref_element_addr %0 : $OtherClass, #OtherClass.arg1
-// CHECK: copy_addr [[R1]] to [initialization] [[A1]] : $*PropProtocol
-// CHECK: [[O1:%.*]] = open_existential_addr immutable_access [[A1]] : $*PropProtocol to $*@opened("{{.*}}") PropProtocol
-// CHECK: [[U1:%.*]] = unchecked_addr_cast [[O1]] : $*@opened("{{.*}}") PropProtocol to $*PropClass
-// CHECK: [[S1:%.*]] = struct_element_addr [[U1]] : $*PropClass, #PropClass.val
-// CHECK: [[S11:%.*]] = struct_element_addr [[S1]] : $*Int, #Int._value
-// CHECK: load [[S11]]
-// CHECK: destroy_addr [[A1]] : $*PropProtocol
-// CHECK: [[A2:%.*]] = alloc_stack $GenericPropProtocol
-// CHECK: [[R2:%.*]] = ref_element_addr %0 : $OtherClass, #OtherClass.arg2
-// CHECK: copy_addr [[R2]] to [initialization] [[A2]] : $*GenericPropProtocol
-// CHECK: [[O2:%.*]] = open_existential_addr immutable_access [[A2]] : $*GenericPropProtocol to $*@opened("{{.*}}") GenericPropProtocol
-// CHECK: [[W2:%.*]] = witness_method $@opened("{{.*}}") GenericPropProtocol, #GenericPropProtocol.val!getter.1 : <Self where Self : GenericPropProtocol> (Self) -> () -> Int, [[O2]] : $*@opened("{{.*}}") GenericPropProtocol : $@convention(witness_method: GenericPropProtocol) <τ_0_0 where τ_0_0 : GenericPropProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: apply [[W2]]<@opened("{{.*}}") GenericPropProtocol>([[O2]]) : $@convention(witness_method: GenericPropProtocol) <τ_0_0 where τ_0_0 : GenericPropProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: destroy_addr [[A2]] : $*GenericPropProtocol
-// CHECK: struct_extract
-// CHECK: integer_literal
-// CHECK: builtin
-// CHECK: tuple_extract
-// CHECK: tuple_extract
-// CHECK: cond_fail
-// CHECK: dealloc_stack [[A2]] : $*GenericPropProtocol
-// CHECK: dealloc_stack [[A1]] : $*PropProtocol
-// CHECK: [[A4:%.*]] = alloc_stack $NestedPropProtocol
-// CHECK: [[R4:%.*]] = ref_element_addr %0 : $OtherClass, #OtherClass.arg3
-// CHECK: copy_addr [[R4]] to [initialization] [[A4]] : $*NestedPropProtocol
-// CHECK: [[O4:%.*]] = open_existential_addr immutable_access [[A4]] : $*NestedPropProtocol to $*@opened("{{.*}}") NestedPropProtocol
-// CHECK: [[U4:%.*]] = unchecked_addr_cast [[O4]] : $*@opened("{{.*}}") NestedPropProtocol to $*Outer.Inner
-// CHECK: [[S4:%.*]] = struct_element_addr [[U4]] : $*Outer.Inner, #Outer.Inner.val
-// CHECK: [[S41:%.*]] = struct_element_addr [[S4]] : $*Int, #Int._value
-// CHECK: load [[S41]]
-// CHECK: builtin
-// CHECK: tuple_extract
-// CHECK: tuple_extract
-// CHECK: cond_fail
-// CHECK: dealloc_stack [[A4]] : $*NestedPropProtocol
-// CHECK: [[A5:%.*]] = alloc_stack $GenericNestedPropProtocol
-// CHECK: [[R5:%.*]] = ref_element_addr %0 : $OtherClass, #OtherClass.arg4
-// CHECK: copy_addr [[R5]] to [initialization] [[A5]] : $*GenericNestedPropProtocol
-// CHECK: [[O5:%.*]] = open_existential_addr immutable_access [[A5]] : $*GenericNestedPropProtocol to $*@opened("{{.*}}") GenericNestedPropProtocol
-// CHECK: [[W5:%.*]] = witness_method $@opened("{{.*}}") GenericNestedPropProtocol, #GenericNestedPropProtocol.val!getter.1 : <Self where Self : GenericNestedPropProtocol> (Self) -> () -> Int, [[O5:%.*]] : $*@opened("{{.*}}") GenericNestedPropProtocol : $@convention(witness_method: GenericNestedPropProtocol) <τ_0_0 where τ_0_0 : GenericNestedPropProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: apply [[W5]]<@opened("{{.*}}") GenericNestedPropProtocol>([[O5]]) : $@convention(witness_method: GenericNestedPropProtocol) <τ_0_0 where τ_0_0 : GenericNestedPropProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: struct_extract
-// CHECK: builtin
-// CHECK: tuple_extract
-// CHECK: tuple_extract
-// CHECK: cond_fail
-// CHECK: struct
-// CHECK: destroy_addr [[A5]] : $*GenericNestedPropProtocol
-// CHECK: dealloc_stack [[A5]] : $*GenericNestedPropProtocol
-// CHECK: return
-// CHECK: } // end sil function '$s25sil_combine_protocol_conf10OtherClassC12doWorkStructSiyF'
+// DISABLE-CHECK: bb0
+// DISABLE-CHECK: debug_value
+// DISABLE-CHECK: [[A1:%.*]] = alloc_stack $PropProtocol
+// DISABLE-CHECK: [[R1:%.*]] = ref_element_addr %0 : $OtherClass, #OtherClass.arg1
+// DISABLE-CHECK: copy_addr [[R1]] to [initialization] [[A1]] : $*PropProtocol
+// DISABLE-CHECK: [[O1:%.*]] = open_existential_addr immutable_access [[A1]] : $*PropProtocol to $*@opened("{{.*}}") PropProtocol
+// DISABLE-CHECK: [[U1:%.*]] = unchecked_addr_cast [[O1]] : $*@opened("{{.*}}") PropProtocol to $*PropClass
+// DISABLE-CHECK: [[S1:%.*]] = struct_element_addr [[U1]] : $*PropClass, #PropClass.val
+// DISABLE-CHECK: [[S11:%.*]] = struct_element_addr [[S1]] : $*Int, #Int._value
+// DISABLE-CHECK: load [[S11]]
+// DISABLE-CHECK: destroy_addr [[A1]] : $*PropProtocol
+// DISABLE-CHECK: [[A2:%.*]] = alloc_stack $GenericPropProtocol
+// DISABLE-CHECK: [[R2:%.*]] = ref_element_addr %0 : $OtherClass, #OtherClass.arg2
+// DISABLE-CHECK: copy_addr [[R2]] to [initialization] [[A2]] : $*GenericPropProtocol
+// DISABLE-CHECK: [[O2:%.*]] = open_existential_addr immutable_access [[A2]] : $*GenericPropProtocol to $*@opened("{{.*}}") GenericPropProtocol
+// DISABLE-CHECK: [[W2:%.*]] = witness_method $@opened("{{.*}}") GenericPropProtocol, #GenericPropProtocol.val!getter.1 : <Self where Self : GenericPropProtocol> (Self) -> () -> Int, [[O2]] : $*@opened("{{.*}}") GenericPropProtocol : $@convention(witness_method: GenericPropProtocol) <τ_0_0 where τ_0_0 : GenericPropProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: apply [[W2]]<@opened("{{.*}}") GenericPropProtocol>([[O2]]) : $@convention(witness_method: GenericPropProtocol) <τ_0_0 where τ_0_0 : GenericPropProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: destroy_addr [[A2]] : $*GenericPropProtocol
+// DISABLE-CHECK: struct_extract
+// DISABLE-CHECK: integer_literal
+// DISABLE-CHECK: builtin
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: cond_fail
+// DISABLE-CHECK: dealloc_stack [[A2]] : $*GenericPropProtocol
+// DISABLE-CHECK: dealloc_stack [[A1]] : $*PropProtocol
+// DISABLE-CHECK: [[A4:%.*]] = alloc_stack $NestedPropProtocol
+// DISABLE-CHECK: [[R4:%.*]] = ref_element_addr %0 : $OtherClass, #OtherClass.arg3
+// DISABLE-CHECK: copy_addr [[R4]] to [initialization] [[A4]] : $*NestedPropProtocol
+// DISABLE-CHECK: [[O4:%.*]] = open_existential_addr immutable_access [[A4]] : $*NestedPropProtocol to $*@opened("{{.*}}") NestedPropProtocol
+// DISABLE-CHECK: [[U4:%.*]] = unchecked_addr_cast [[O4]] : $*@opened("{{.*}}") NestedPropProtocol to $*Outer.Inner
+// DISABLE-CHECK: [[S4:%.*]] = struct_element_addr [[U4]] : $*Outer.Inner, #Outer.Inner.val
+// DISABLE-CHECK: [[S41:%.*]] = struct_element_addr [[S4]] : $*Int, #Int._value
+// DISABLE-CHECK: load [[S41]]
+// DISABLE-CHECK: builtin
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: cond_fail
+// DISABLE-CHECK: dealloc_stack [[A4]] : $*NestedPropProtocol
+// DISABLE-CHECK: [[A5:%.*]] = alloc_stack $GenericNestedPropProtocol
+// DISABLE-CHECK: [[R5:%.*]] = ref_element_addr %0 : $OtherClass, #OtherClass.arg4
+// DISABLE-CHECK: copy_addr [[R5]] to [initialization] [[A5]] : $*GenericNestedPropProtocol
+// DISABLE-CHECK: [[O5:%.*]] = open_existential_addr immutable_access [[A5]] : $*GenericNestedPropProtocol to $*@opened("{{.*}}") GenericNestedPropProtocol
+// DISABLE-CHECK: [[W5:%.*]] = witness_method $@opened("{{.*}}") GenericNestedPropProtocol, #GenericNestedPropProtocol.val!getter.1 : <Self where Self : GenericNestedPropProtocol> (Self) -> () -> Int, [[O5:%.*]] : $*@opened("{{.*}}") GenericNestedPropProtocol : $@convention(witness_method: GenericNestedPropProtocol) <τ_0_0 where τ_0_0 : GenericNestedPropProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: apply [[W5]]<@opened("{{.*}}") GenericNestedPropProtocol>([[O5]]) : $@convention(witness_method: GenericNestedPropProtocol) <τ_0_0 where τ_0_0 : GenericNestedPropProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: struct_extract
+// DISABLE-CHECK: builtin
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: cond_fail
+// DISABLE-CHECK: struct
+// DISABLE-CHECK: destroy_addr [[A5]] : $*GenericNestedPropProtocol
+// DISABLE-CHECK: dealloc_stack [[A5]] : $*GenericNestedPropProtocol
+// DISABLE-CHECK: return
+// DISABLE-CHECK: } // end sil function '$s25sil_combine_protocol_conf10OtherClassC12doWorkStructSiyF'
@inline(never) func doWorkStruct () -> Int{
return self.arg1.val // optimize
+ self.arg2.val // do not optimize
@@ -336,26 +336,26 @@
}
// CHECK-LABEL: sil hidden [noinline] @$s25sil_combine_protocol_conf10OtherKlassC10doWorkEnumSiyF : $@convention(method) (@guaranteed OtherKlass) -> Int {
-// CHECK: bb0
-// CHECK: debug_value
-// CHECK: integer_literal
-// CHECK: [[A1:%.*]] = alloc_stack $AGenericProtocol
-// CHECK: [[R1:%.*]] = ref_element_addr %0 : $OtherKlass, #OtherKlass.arg2
-// CHECK: copy_addr [[R1]] to [initialization] [[A1]] : $*AGenericProtocol
-// CHECK: [[O1:%.*]] = open_existential_addr immutable_access [[A1]] : $*AGenericProtocol to $*@opened("{{.*}}") AGenericProtocol
-// CHECK: [[W1:%.*]] = witness_method $@opened("{{.*}}") AGenericProtocol, #AGenericProtocol.val!getter.1 : <Self where Self : AGenericProtocol> (Self) -> () -> Int, [[O1]] : $*@opened("{{.*}}") AGenericProtocol : $@convention(witness_method: AGenericProtocol) <τ_0_0 where τ_0_0 : AGenericProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: apply [[W1]]<@opened("{{.*}}") AGenericProtocol>([[O1]]) : $@convention(witness_method: AGenericProtocol) <τ_0_0 where τ_0_0 : AGenericProtocol> (@in_guaranteed τ_0_0) -> Int
-// CHECK: struct_extract
-// CHECK: integer_literal
-// CHECK: builtin
-// CHECK: tuple_extract
-// CHECK: tuple_extract
-// CHECK: cond_fail
-// CHECK: struct
-// CHECK: destroy_addr [[A1]] : $*AGenericProtocol
-// CHECK: dealloc_stack [[A1]] : $*AGenericProtocol
-// CHECK: return
-// CHECK: } // end sil function '$s25sil_combine_protocol_conf10OtherKlassC10doWorkEnumSiyF'
+// DISABLE-CHECK: bb0
+// DISABLE-CHECK: debug_value
+// DISABLE-CHECK: integer_literal
+// DISABLE-CHECK: [[A1:%.*]] = alloc_stack $AGenericProtocol
+// DISABLE-CHECK: [[R1:%.*]] = ref_element_addr %0 : $OtherKlass, #OtherKlass.arg2
+// DISABLE-CHECK: copy_addr [[R1]] to [initialization] [[A1]] : $*AGenericProtocol
+// DISABLE-CHECK: [[O1:%.*]] = open_existential_addr immutable_access [[A1]] : $*AGenericProtocol to $*@opened("{{.*}}") AGenericProtocol
+// DISABLE-CHECK: [[W1:%.*]] = witness_method $@opened("{{.*}}") AGenericProtocol, #AGenericProtocol.val!getter.1 : <Self where Self : AGenericProtocol> (Self) -> () -> Int, [[O1]] : $*@opened("{{.*}}") AGenericProtocol : $@convention(witness_method: AGenericProtocol) <τ_0_0 where τ_0_0 : AGenericProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: apply [[W1]]<@opened("{{.*}}") AGenericProtocol>([[O1]]) : $@convention(witness_method: AGenericProtocol) <τ_0_0 where τ_0_0 : AGenericProtocol> (@in_guaranteed τ_0_0) -> Int
+// DISABLE-CHECK: struct_extract
+// DISABLE-CHECK: integer_literal
+// DISABLE-CHECK: builtin
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: tuple_extract
+// DISABLE-CHECK: cond_fail
+// DISABLE-CHECK: struct
+// DISABLE-CHECK: destroy_addr [[A1]] : $*AGenericProtocol
+// DISABLE-CHECK: dealloc_stack [[A1]] : $*AGenericProtocol
+// DISABLE-CHECK: return
+// DISABLE-CHECK: } // end sil function '$s25sil_combine_protocol_conf10OtherKlassC10doWorkEnumSiyF'
@inline(never) func doWorkEnum() -> Int {
return self.arg1.val // optimize
+ self.arg2.val // do not optimize
diff --git a/test/SILOptimizer/specialize_self_conforming_error.swift b/test/SILOptimizer/specialize_self_conforming_error.swift
new file mode 100644
index 0000000..2c6bd1b
--- /dev/null
+++ b/test/SILOptimizer/specialize_self_conforming_error.swift
@@ -0,0 +1,97 @@
+// RUN: %target-swift-frontend -module-name specialize_self_conforming -emit-sil -O -primary-file %s | %FileCheck %s
+
+// Test 1: apply the substitution
+// [U:Error => Error:Error]
+// to the type argument map
+// [T:Error => U:Error]
+// on the call to takesError.
+
+@_optimize(none)
+func takesError<T : Error>(_: T) {}
+
+@inline(__always)
+func callsTakesError<U : Error>(_ error: U) {
+ takesError(error)
+}
+
+// CHECK-LABEL: sil hidden @$s26specialize_self_conforming5test1yys5Error_pF : $@convention(thin) (@guaranteed Error) -> () {
+// CHECK: [[TEMP:%.*]] = alloc_stack $Error
+// CHECK: store %0 to [[TEMP]]
+// CHECK: [[FN:%.*]] = function_ref @$s26specialize_self_conforming10takesErroryyxs0E0RzlF : $@convention(thin) <τ_0_0 where τ_0_0 : Error> (@in_guaranteed τ_0_0) -> ()
+// CHECK: apply [[FN]]<Error>([[TEMP]]) : $@convention(thin) <τ_0_0 where τ_0_0 : Error> (@in_guaranteed τ_0_0) -> ()
+// CHECK: dealloc_stack [[TEMP]]
+// CHECK: return
+
+func test1(_ error: Error) {
+ callsTakesError(error)
+}
+
+// Test 2: apply the substitution
+// [U => Int]
+// to the type argument map
+// [T:Error => Error:Error]
+// on the call to takesError.
+
+@inline(__always)
+func callsTakesErrorWithError<U>(_ error: Error, _ value : U) {
+ takesError(error)
+}
+
+// CHECK-LABEL: sil hidden @$s26specialize_self_conforming5test2yys5Error_pF : $@convention(thin) (@guaranteed Error) -> () {
+// CHECK: [[TEMP:%.*]] = alloc_stack $Error
+// CHECK: store %0 to [[TEMP]]
+// CHECK: [[FN:%.*]] = function_ref @$s26specialize_self_conforming10takesErroryyxs0E0RzlF : $@convention(thin) <τ_0_0 where τ_0_0 : Error> (@in_guaranteed τ_0_0) -> ()
+// CHECK: apply [[FN]]<Error>([[TEMP]]) : $@convention(thin) <τ_0_0 where τ_0_0 : Error> (@in_guaranteed τ_0_0) -> ()
+// CHECK: dealloc_stack [[TEMP]]
+// CHECK: return
+
+func test2(_ error: Error) {
+ callsTakesErrorWithError(error, 0)
+}
+
+// Test 3: apply the substitution
+// [V => Int]
+// to the type argument map
+// [T:Error => Error:Error, U => V]
+// on the call to takesErrorAndValue.
+
+@_optimize(none)
+func takesErrorAndValue<T : Error, U>(_: T, _: U) {}
+
+@inline(__always)
+func callsTakesErrorAndValueWithError<U>(_ error: Error, _ value : U) {
+ takesErrorAndValue(error, value)
+}
+
+// CHECK-LABEL: sil hidden @$s26specialize_self_conforming5test3yys5Error_pF : $@convention(thin) (@guaranteed Error) -> () {
+// CHECK: [[TEMP:%.*]] = alloc_stack $Error
+// CHECK: store %0 to [[TEMP]]
+// CHECK: [[FN:%.*]] = function_ref @$s26specialize_self_conforming18takesErrorAndValueyyx_q_ts0E0Rzr0_lF : $@convention(thin) <τ_0_0, τ_0_1 where τ_0_0 : Error> (@in_guaranteed τ_0_0, @in_guaranteed τ_0_1) -> ()
+// CHECK: apply [[FN]]<Error, Int>([[TEMP]], {{%.*}}) :
+// CHECK: dealloc_stack [[TEMP]]
+// CHECK: return
+
+func test3(_ error: Error) {
+ callsTakesErrorAndValueWithError(error, 0)
+}
+
+// Test 4: just clone the type argument map
+// [Self:P => opened:P, T:Error => Error:Error]
+// When the inliner is cloning a substitution map that includes an opened
+// archetype, it uses a substitution function that expects not to be called
+// on types it's not expecting.
+
+protocol P {}
+extension P {
+ @_optimize(none)
+ func exTakesError<T: Error>(_: T) {}
+}
+
+@inline(__always)
+func callsExTakesErrorWithError(_ p: P, _ error: Error) {
+ p.exTakesError(error)
+}
+
+func test4(_ p: P, _ error: Error) {
+ callsExTakesErrorWithError(p, error)
+}
diff --git a/test/Sema/diag_invalid_inout_captures.swift b/test/Sema/diag_invalid_inout_captures.swift
index b8997c7..354dfb8 100644
--- a/test/Sema/diag_invalid_inout_captures.swift
+++ b/test/Sema/diag_invalid_inout_captures.swift
@@ -6,7 +6,8 @@
struct you_cry_in_your_tea {
mutating func which_you_hurl_in_the_sea_when_you_see_me_go_by() {
no_escape { _ = self } // OK
- do_escape { _ = self } // expected-error {{closure cannot implicitly capture a mutating self parameter}}
+ do_escape { _ = self } // expected-error {{escaping closure cannot capture a mutating self parameter}}
+ // expected-note@-1 {{create a mutating copy of self, or explicitly capture self for immutability}}
do_escape {
[self] in
_ = self // OK
@@ -40,3 +41,23 @@
func its_complicated(condition: inout Int) {
no_escape(condition == 0 ? { condition = 1 } : { condition = 2}) // expected-error 2 {{escaping closures can only capture inout parameters explicitly by value}}
}
+
+// rdar://problem/46322943 - Improve error message about mutating self capture in escaping closures
+func rdar46322943() {
+ struct S {
+ var bar = 1
+
+ func foo(_ fn: () -> Void) {
+ fn()
+ }
+
+ mutating func main() {
+ let fn = {
+ self.bar += 1
+ // expected-error@-1 {{escaping closure cannot capture a mutating self parameter}}
+ // expected-note@-2 {{create a mutating copy of self, or explicitly capture self for immutability}}
+ }
+ self.foo(fn)
+ }
+ }
+}
diff --git a/test/Sema/typo_correction.swift b/test/Sema/typo_correction.swift
index 033d4b5..af9010b 100644
--- a/test/Sema/typo_correction.swift
+++ b/test/Sema/typo_correction.swift
@@ -1,4 +1,4 @@
-// RUN: %target-typecheck-verify-swift -typo-correction-limit 22
+// RUN: %target-typecheck-verify-swift -typo-correction-limit 23
// RUN: not %target-swift-frontend -typecheck -disable-typo-correction %s 2>&1 | %FileCheck %s -check-prefix=DISABLED
// RUN: not %target-swift-frontend -typecheck -typo-correction-limit 0 %s 2>&1 | %FileCheck %s -check-prefix=DISABLED
// RUN: not %target-swift-frontend -typecheck -DIMPORT_FAIL %s 2>&1 | %FileCheck %s -check-prefix=DISABLED
@@ -191,3 +191,9 @@
_ = _fggs + 1
// expected-error@-1 {{use of unresolved identifier '_fggs'; did you mean '_eggs'?}}
}
+
+// Don't show values before declaration.
+func testFwdRef() {
+ let _ = forward_refX + 1 // expected-error {{use of unresolved identifier 'forward_refX'}}
+ let forward_ref1 = 4
+}
diff --git a/test/Serialization/load-arch-fallback-framework.swift b/test/Serialization/load-arch-fallback-framework.swift
new file mode 100644
index 0000000..c0f2dc4
--- /dev/null
+++ b/test/Serialization/load-arch-fallback-framework.swift
@@ -0,0 +1,18 @@
+// Test the fallback for 32-bit ARM platforms.
+
+// RUN: %empty-directory(%t)
+// RUN: mkdir -p %t/empty.framework/Modules/empty.swiftmodule
+// RUN: %target-swift-frontend -emit-module -o %t/empty.framework/Modules/empty.swiftmodule/arm.swiftmodule %S/../Inputs/empty.swift -module-name empty
+// RUN: %target-swift-frontend -typecheck %s -F %t
+
+// RUN: mv %t/empty.framework/Modules/empty.swiftmodule/arm.swiftmodule %t/empty.framework/Modules/empty.swiftmodule/%target-swiftmodule-name
+// RUN: touch %t/empty.framework/Modules/empty.swiftmodule/arm.swiftmodule
+// RUN: %target-swift-frontend -typecheck %s -F %t
+
+// RUN: rm %t/empty.framework/Modules/empty.swiftmodule/%target-swiftmodule-name
+// RUN: not %target-swift-frontend -typecheck %s -F %t 2>&1 | %FileCheck %s
+
+// REQUIRES: CPU=armv7 || CPU=armv7k || CPU=armv7s
+
+import empty
+// CHECK: :[[@LINE-1]]:8: error: malformed module file: {{.*}}arm.swiftmodule
diff --git a/test/Serialization/load-arch-fallback.swift b/test/Serialization/load-arch-fallback.swift
new file mode 100644
index 0000000..a8f978e
--- /dev/null
+++ b/test/Serialization/load-arch-fallback.swift
@@ -0,0 +1,18 @@
+// Test the fallback for 32-bit ARM platforms.
+
+// RUN: %empty-directory(%t)
+// RUN: mkdir %t/empty.swiftmodule
+// RUN: %target-swift-frontend -emit-module -o %t/empty.swiftmodule/arm.swiftmodule %S/../Inputs/empty.swift -module-name empty
+// RUN: %target-swift-frontend -typecheck %s -I %t
+
+// RUN: mv %t/empty.swiftmodule/arm.swiftmodule %t/empty.swiftmodule/%target-swiftmodule-name
+// RUN: touch %t/empty.swiftmodule/arm.swiftmodule
+// RUN: %target-swift-frontend -typecheck %s -I %t
+
+// RUN: rm %t/empty.swiftmodule/%target-swiftmodule-name
+// RUN: not %target-swift-frontend -typecheck %s -I %t 2>&1 | %FileCheck %s
+
+// REQUIRES: CPU=armv7 || CPU=armv7k || CPU=armv7s
+
+import empty
+// CHECK: :[[@LINE-1]]:8: error: malformed module file: {{.*}}arm.swiftmodule
diff --git a/test/SourceKit/CodeComplete/complete_moduleimportdepth.swift b/test/SourceKit/CodeComplete/complete_moduleimportdepth.swift
index d30b140..808ab0d 100644
--- a/test/SourceKit/CodeComplete/complete_moduleimportdepth.swift
+++ b/test/SourceKit/CodeComplete/complete_moduleimportdepth.swift
@@ -23,18 +23,6 @@
// CHECK: key.modulename: "Swift"
// CHECK-NEXT: },
-// CHECK-LABEL: key.name: "abs(:)",
-// CHECK-NEXT: key.sourcetext: "abs(<#T##x: Comparable & SignedNumeric##Comparable & SignedNumeric#>)",
-// CHECK-NEXT: key.description: "abs(x: Comparable & SignedNumeric)",
-// CHECK-NEXT: key.typename: "Comparable & SignedNumeric",
-// CHECK-NEXT: key.doc.brief: "Returns the absolute value of the given number.",
-// CHECK-NEXT: key.context: source.codecompletion.context.othermodule,
-// CHECK-NEXT: key.moduleimportdepth: 1,
-// CHECK-NEXT: key.num_bytes_to_erase: 0,
-// CHECK-NOT: key.modulename
-// CHECK: key.modulename: "Swift"
-// CHECK-NEXT: },
-
// FooHelper.FooHelperExplicit == 1
// CHECK-LABEL: key.name: "fooHelperExplicitFrameworkFunc1(:)",
// CHECK-NEXT: key.sourcetext: "fooHelperExplicitFrameworkFunc1(<#T##a: Int32##Int32#>)",
diff --git a/test/SourceKit/DocSupport/doc_clang_module.swift.response b/test/SourceKit/DocSupport/doc_clang_module.swift.response
index 3c6a5b6..7c3d3a4 100644
--- a/test/SourceKit/DocSupport/doc_clang_module.swift.response
+++ b/test/SourceKit/DocSupport/doc_clang_module.swift.response
@@ -65,7 +65,7 @@
extension FooRuncingOptions {
- @inlinable init<S>(_ sequence: __owned S) where S : Sequence, FooRuncingOptions.Element == S.Element
+ @inlinable init<S>(_ sequence: __owned S) where S : Sequence, Self.Element == S.Element
@inlinable mutating func subtract(_ other: FooRuncingOptions)
@@ -1304,1242 +1304,1257 @@
key.length: 8
},
{
- key.kind: source.lang.swift.ref.struct,
- key.name: "FooRuncingOptions",
- key.usr: "c:@E@FooRuncingOptions",
+ key.kind: source.lang.swift.ref.generic_type_param,
+ key.name: "Self",
+ key.usr: "s:s10SetAlgebraP4Selfxmfp",
key.offset: 1542,
- key.length: 17
+ key.length: 4
},
{
- key.kind: source.lang.swift.ref.typealias,
- key.name: "Element",
- key.usr: "s:So17FooRuncingOptionsV7Elementa",
+ key.kind: source.lang.swift.syntaxtype.typeidentifier,
+ key.offset: 1547,
+ key.length: 7
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.typeidentifier,
+ key.offset: 1558,
+ key.length: 1
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 1560,
key.length: 7
},
{
- key.kind: source.lang.swift.syntaxtype.typeidentifier,
- key.offset: 1571,
- key.length: 1
- },
- {
- key.kind: source.lang.swift.syntaxtype.typeidentifier,
+ key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 1573,
- key.length: 7
- },
- {
- key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 1586,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 1597,
+ key.offset: 1584,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 1606,
+ key.offset: 1593,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 1611,
+ key.offset: 1598,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 1620,
+ key.offset: 1607,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 1622,
+ key.offset: 1609,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 1629,
+ key.offset: 1616,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 1653,
+ key.offset: 1640,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 1664,
+ key.offset: 1651,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 1669,
+ key.offset: 1656,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 1678,
+ key.offset: 1665,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 1681,
+ key.offset: 1668,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 1688,
+ key.offset: 1675,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 1710,
+ key.offset: 1697,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 1720,
+ key.offset: 1707,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 1731,
+ key.offset: 1718,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 1736,
+ key.offset: 1723,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 1747,
+ key.offset: 1734,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 1750,
+ key.offset: 1737,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 1757,
+ key.offset: 1744,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 1779,
+ key.offset: 1766,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 1789,
+ key.offset: 1776,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 1800,
+ key.offset: 1787,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 1805,
+ key.offset: 1792,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 1816,
+ key.offset: 1803,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 1821,
+ key.offset: 1808,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 1828,
+ key.offset: 1815,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 1850,
+ key.offset: 1837,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 1860,
+ key.offset: 1847,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 1871,
+ key.offset: 1858,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 1876,
+ key.offset: 1863,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 1888,
+ key.offset: 1875,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 1890,
+ key.offset: 1877,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 1897,
+ key.offset: 1884,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 1919,
+ key.offset: 1906,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 1942,
+ key.offset: 1929,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 1953,
+ key.offset: 1940,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 1957,
+ key.offset: 1944,
key.length: 7
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 1966,
+ key.offset: 1953,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 1973,
+ key.offset: 1960,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 1984,
+ key.offset: 1971,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 1995,
+ key.offset: 1982,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2000,
+ key.offset: 1987,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2017,
+ key.offset: 2004,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2020,
+ key.offset: 2007,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2027,
+ key.offset: 2014,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 2049,
+ key.offset: 2036,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2059,
+ key.offset: 2046,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2070,
+ key.offset: 2057,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2075,
+ key.offset: 2062,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2090,
+ key.offset: 2077,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2093,
+ key.offset: 2080,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2100,
+ key.offset: 2087,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 2122,
+ key.offset: 2109,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2130,
+ key.offset: 2117,
key.length: 9
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2140,
+ key.offset: 2127,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2165,
+ key.offset: 2152,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2176,
+ key.offset: 2163,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2181,
+ key.offset: 2168,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2187,
+ key.offset: 2174,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2189,
+ key.offset: 2176,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2196,
+ key.offset: 2183,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2218,
+ key.offset: 2205,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2241,
+ key.offset: 2228,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2252,
+ key.offset: 2239,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2257,
+ key.offset: 2244,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2270,
+ key.offset: 2257,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2272,
+ key.offset: 2259,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2279,
+ key.offset: 2266,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2301,
+ key.offset: 2288,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2324,
+ key.offset: 2311,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2335,
+ key.offset: 2322,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2340,
+ key.offset: 2327,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2360,
+ key.offset: 2347,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2362,
+ key.offset: 2349,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2369,
+ key.offset: 2356,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2391,
+ key.offset: 2378,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2412,
+ key.offset: 2399,
key.length: 9
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2422,
+ key.offset: 2409,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2447,
+ key.offset: 2434,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2458,
+ key.offset: 2445,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2463,
+ key.offset: 2450,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2472,
+ key.offset: 2459,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2474,
+ key.offset: 2461,
key.length: 6
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2482,
+ key.offset: 2469,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 2504,
+ key.offset: 2491,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2514,
+ key.offset: 2501,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2525,
+ key.offset: 2512,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2534,
+ key.offset: 2521,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2539,
+ key.offset: 2526,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.argument,
+ key.offset: 2533,
+ key.length: 1
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.parameter,
+ key.offset: 2535,
+ key.length: 9
+ },
+ {
+ key.kind: source.lang.swift.ref.struct,
+ key.name: "FooRuncingOptions",
+ key.usr: "c:@E@FooRuncingOptions",
key.offset: 2546,
- key.length: 1
- },
- {
- key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2548,
- key.length: 9
- },
- {
- key.kind: source.lang.swift.ref.struct,
- key.name: "FooRuncingOptions",
- key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2559,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2582,
+ key.offset: 2569,
key.length: 8
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 2592,
+ key.offset: 2579,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2598,
+ key.offset: 2585,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2617,
+ key.offset: 2604,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2641,
+ key.offset: 2628,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2652,
+ key.offset: 2639,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2661,
+ key.offset: 2648,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2666,
+ key.offset: 2653,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2673,
+ key.offset: 2660,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2675,
+ key.offset: 2662,
key.length: 6
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2683,
+ key.offset: 2670,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2705,
+ key.offset: 2692,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2729,
+ key.offset: 2716,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2740,
+ key.offset: 2727,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2749,
+ key.offset: 2736,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2754,
+ key.offset: 2741,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2761,
+ key.offset: 2748,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2766,
+ key.offset: 2753,
key.length: 9
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2777,
+ key.offset: 2764,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2799,
+ key.offset: 2786,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2821,
+ key.offset: 2808,
key.length: 9
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2831,
+ key.offset: 2818,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2856,
+ key.offset: 2843,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2867,
+ key.offset: 2854,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2879,
+ key.offset: 2866,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2890,
+ key.offset: 2877,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2899,
+ key.offset: 2886,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2904,
+ key.offset: 2891,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2914,
+ key.offset: 2901,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2916,
+ key.offset: 2903,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2923,
+ key.offset: 2910,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2947,
+ key.offset: 2934,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 2958,
+ key.offset: 2945,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 2967,
+ key.offset: 2954,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 2972,
+ key.offset: 2959,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 2989,
+ key.offset: 2976,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 2991,
+ key.offset: 2978,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 2998,
+ key.offset: 2985,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 3022,
+ key.offset: 3009,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 3033,
+ key.offset: 3020,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3042,
+ key.offset: 3029,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3047,
+ key.offset: 3034,
key.length: 23
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3071,
+ key.offset: 3058,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3073,
+ key.offset: 3060,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
key.usr: "c:@E@FooRuncingOptions",
- key.offset: 3080,
+ key.offset: 3067,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3101,
+ key.offset: 3088,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3108,
+ key.offset: 3095,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3126,
+ key.offset: 3113,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3130,
+ key.offset: 3117,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3133,
+ key.offset: 3120,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3144,
+ key.offset: 3131,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3148,
+ key.offset: 3135,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Double",
key.usr: "s:Sd",
- key.offset: 3151,
+ key.offset: 3138,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3163,
+ key.offset: 3150,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3175,
+ key.offset: 3162,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3180,
+ key.offset: 3167,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3182,
+ key.offset: 3169,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3185,
+ key.offset: 3172,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3192,
+ key.offset: 3179,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
+ key.offset: 3181,
+ key.length: 1
+ },
+ {
+ key.kind: source.lang.swift.ref.struct,
+ key.name: "Double",
+ key.usr: "s:Sd",
+ key.offset: 3184,
+ key.length: 6
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 3194,
- key.length: 1
- },
- {
- key.kind: source.lang.swift.ref.struct,
- key.name: "Double",
- key.usr: "s:Sd",
- key.offset: 3197,
- key.length: 6
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3207,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3217,
+ key.offset: 3204,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UnsafeMutablePointer",
key.usr: "s:Sp",
- key.offset: 3237,
+ key.offset: 3224,
key.length: 20
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooStruct1",
key.usr: "c:@S@FooStruct1",
- key.offset: 3258,
+ key.offset: 3245,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3270,
+ key.offset: 3257,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3277,
+ key.offset: 3264,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3295,
+ key.offset: 3282,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3299,
+ key.offset: 3286,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3302,
+ key.offset: 3289,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3313,
+ key.offset: 3300,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3317,
+ key.offset: 3304,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Double",
key.usr: "s:Sd",
- key.offset: 3320,
+ key.offset: 3307,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3332,
+ key.offset: 3319,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3344,
+ key.offset: 3331,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3349,
+ key.offset: 3336,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3351,
+ key.offset: 3338,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3354,
+ key.offset: 3341,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3361,
+ key.offset: 3348,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
+ key.offset: 3350,
+ key.length: 1
+ },
+ {
+ key.kind: source.lang.swift.ref.struct,
+ key.name: "Double",
+ key.usr: "s:Sd",
+ key.offset: 3353,
+ key.length: 6
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 3363,
- key.length: 1
- },
- {
- key.kind: source.lang.swift.ref.struct,
- key.name: "Double",
- key.usr: "s:Sd",
- key.offset: 3366,
- key.length: 6
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3376,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3386,
+ key.offset: 3373,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooStruct2",
key.usr: "c:@S@FooStruct2",
- key.offset: 3406,
+ key.offset: 3393,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3417,
+ key.offset: 3404,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3424,
+ key.offset: 3411,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3449,
+ key.offset: 3436,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3453,
+ key.offset: 3440,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3456,
+ key.offset: 3443,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3467,
+ key.offset: 3454,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3471,
+ key.offset: 3458,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Double",
key.usr: "s:Sd",
- key.offset: 3474,
+ key.offset: 3461,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3486,
+ key.offset: 3473,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3498,
+ key.offset: 3485,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3503,
+ key.offset: 3490,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3505,
+ key.offset: 3492,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3508,
+ key.offset: 3495,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3515,
+ key.offset: 3502,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
+ key.offset: 3504,
+ key.length: 1
+ },
+ {
+ key.kind: source.lang.swift.ref.struct,
+ key.name: "Double",
+ key.usr: "s:Sd",
+ key.offset: 3507,
+ key.length: 6
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 3517,
- key.length: 1
- },
- {
- key.kind: source.lang.swift.ref.struct,
- key.name: "Double",
- key.usr: "s:Sd",
- key.offset: 3520,
- key.length: 6
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3530,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3540,
+ key.offset: 3527,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3554,
+ key.offset: 3541,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3560,
+ key.offset: 3547,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3564,
+ key.offset: 3551,
key.length: 9
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3575,
+ key.offset: 3562,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3581,
+ key.offset: 3568,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3586,
+ key.offset: 3573,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3595,
+ key.offset: 3582,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3597,
+ key.offset: 3584,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3600,
+ key.offset: 3587,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3610,
+ key.offset: 3597,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3616,
+ key.offset: 3603,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3621,
+ key.offset: 3608,
key.length: 22
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3644,
+ key.offset: 3631,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3646,
+ key.offset: 3633,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3649,
+ key.offset: 3636,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3659,
+ key.offset: 3646,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3665,
+ key.offset: 3652,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3670,
+ key.offset: 3657,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3679,
+ key.offset: 3666,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3681,
+ key.offset: 3668,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3684,
+ key.offset: 3671,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3691,
+ key.offset: 3678,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3693,
+ key.offset: 3680,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Float",
key.usr: "s:Sf",
- key.offset: 3696,
+ key.offset: 3683,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.argument,
+ key.offset: 3690,
+ key.length: 1
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.parameter,
+ key.offset: 3692,
+ key.length: 1
+ },
+ {
+ key.kind: source.lang.swift.ref.struct,
+ key.name: "Double",
+ key.usr: "s:Sd",
+ key.offset: 3695,
+ key.length: 6
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.argument,
key.offset: 3703,
key.length: 1
},
@@ -2550,2225 +2565,2208 @@
},
{
key.kind: source.lang.swift.ref.struct,
- key.name: "Double",
- key.usr: "s:Sd",
- key.offset: 3708,
- key.length: 6
- },
- {
- key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3716,
- key.length: 1
- },
- {
- key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3718,
- key.length: 1
- },
- {
- key.kind: source.lang.swift.ref.struct,
key.name: "UnsafeMutablePointer",
key.usr: "s:Sp",
- key.offset: 3721,
+ key.offset: 3708,
key.length: 20
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3742,
+ key.offset: 3729,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3754,
+ key.offset: 3741,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3760,
+ key.offset: 3747,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3765,
+ key.offset: 3752,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3782,
+ key.offset: 3769,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3784,
+ key.offset: 3771,
key.length: 3
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Float",
key.usr: "s:Sf",
- key.offset: 3791,
+ key.offset: 3778,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3801,
+ key.offset: 3788,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3810,
+ key.offset: 3797,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3815,
+ key.offset: 3802,
key.length: 26
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 3842,
+ key.offset: 3829,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 3844,
+ key.offset: 3831,
key.length: 4
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Float",
key.usr: "s:Sf",
- key.offset: 3852,
+ key.offset: 3839,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 3862,
+ key.offset: 3849,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3871,
+ key.offset: 3858,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3876,
+ key.offset: 3863,
key.length: 16
},
{
key.kind: source.lang.swift.ref.enum,
key.name: "Never",
key.usr: "s:s5NeverO",
- key.offset: 3898,
+ key.offset: 3885,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3904,
+ key.offset: 3891,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3909,
+ key.offset: 3896,
key.length: 16
},
{
key.kind: source.lang.swift.ref.enum,
key.name: "Never",
key.usr: "s:s5NeverO",
- key.offset: 3931,
+ key.offset: 3918,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3937,
+ key.offset: 3924,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3942,
+ key.offset: 3929,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3964,
+ key.offset: 3951,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3969,
+ key.offset: 3956,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 3991,
+ key.offset: 3978,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 3996,
+ key.offset: 3983,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4018,
+ key.offset: 4005,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4023,
+ key.offset: 4010,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4045,
+ key.offset: 4032,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4050,
+ key.offset: 4037,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4072,
+ key.offset: 4059,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4077,
+ key.offset: 4064,
key.length: 32
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 4110,
+ key.offset: 4097,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 4112,
+ key.offset: 4099,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 4115,
+ key.offset: 4102,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 4125,
+ key.offset: 4112,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4131,
+ key.offset: 4118,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4140,
+ key.offset: 4127,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4163,
+ key.offset: 4150,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4168,
+ key.offset: 4155,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4188,
+ key.offset: 4175,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4193,
+ key.offset: 4180,
key.length: 33
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4234,
+ key.offset: 4221,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4239,
+ key.offset: 4226,
key.length: 33
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4280,
+ key.offset: 4267,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4287,
+ key.offset: 4274,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4292,
+ key.offset: 4279,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4317,
+ key.offset: 4304,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4321,
+ key.offset: 4308,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 4335,
+ key.offset: 4322,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4343,
+ key.offset: 4330,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4347,
+ key.offset: 4334,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4358,
+ key.offset: 4345,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4362,
+ key.offset: 4349,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 4376,
+ key.offset: 4363,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4384,
+ key.offset: 4371,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4388,
+ key.offset: 4375,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4399,
+ key.offset: 4386,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4403,
+ key.offset: 4390,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 4417,
+ key.offset: 4404,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4425,
+ key.offset: 4412,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4433,
+ key.offset: 4420,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4442,
+ key.offset: 4429,
key.length: 18
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "FooProtocolBase",
key.usr: "c:objc(pl)FooProtocolBase",
- key.offset: 4463,
+ key.offset: 4450,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4483,
+ key.offset: 4470,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4489,
+ key.offset: 4476,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4509,
+ key.offset: 4496,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4514,
+ key.offset: 4501,
key.length: 20
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4542,
+ key.offset: 4529,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4547,
+ key.offset: 4534,
key.length: 20
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 4568,
+ key.offset: 4555,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 4570,
+ key.offset: 4557,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4580,
+ key.offset: 4567,
key.length: 3
},
{
key.kind: source.lang.swift.ref.class,
key.name: "FooClassBase",
key.usr: "c:objc(cs)FooClassBase",
- key.offset: 4589,
+ key.offset: 4576,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4608,
+ key.offset: 4595,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 4621,
+ key.offset: 4608,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4633,
+ key.offset: 4620,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 4639,
+ key.offset: 4626,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 4645,
+ key.offset: 4632,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Float",
key.usr: "s:Sf",
- key.offset: 4648,
+ key.offset: 4635,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4660,
+ key.offset: 4647,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4665,
+ key.offset: 4652,
key.length: 29
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4702,
+ key.offset: 4689,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4708,
+ key.offset: 4695,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4713,
+ key.offset: 4700,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4738,
+ key.offset: 4725,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4743,
+ key.offset: 4730,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4763,
+ key.offset: 4750,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4773,
+ key.offset: 4760,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4778,
+ key.offset: 4765,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4798,
+ key.offset: 4785,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4808,
+ key.offset: 4795,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4813,
+ key.offset: 4800,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4834,
+ key.offset: 4821,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4844,
+ key.offset: 4831,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4849,
+ key.offset: 4836,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4869,
+ key.offset: 4856,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4876,
+ key.offset: 4863,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4882,
+ key.offset: 4869,
key.length: 15
},
{
key.kind: source.lang.swift.ref.class,
key.name: "FooClassBase",
key.usr: "c:objc(cs)FooClassBase",
- key.offset: 4900,
+ key.offset: 4887,
key.length: 12
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "FooProtocolDerived",
key.usr: "c:objc(pl)FooProtocolDerived",
- key.offset: 4914,
+ key.offset: 4901,
key.length: 18
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4940,
+ key.offset: 4927,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4944,
+ key.offset: 4931,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 4958,
+ key.offset: 4945,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4969,
+ key.offset: 4956,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 4973,
+ key.offset: 4960,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 4987,
+ key.offset: 4974,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 4998,
+ key.offset: 4985,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5002,
+ key.offset: 4989,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5016,
+ key.offset: 5003,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5024,
+ key.offset: 5011,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5035,
+ key.offset: 5022,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5040,
+ key.offset: 5027,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5064,
+ key.offset: 5051,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5069,
+ key.offset: 5056,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 5086,
+ key.offset: 5073,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 5088,
+ key.offset: 5075,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5091,
+ key.offset: 5078,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5103,
+ key.offset: 5090,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5108,
+ key.offset: 5095,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 5125,
+ key.offset: 5112,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 5127,
+ key.offset: 5114,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
+ key.offset: 5117,
+ key.length: 5
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.argument,
+ key.offset: 5124,
+ key.length: 5
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.parameter,
key.offset: 5130,
- key.length: 5
- },
- {
- key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 5137,
- key.length: 5
- },
- {
- key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 5143,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5146,
+ key.offset: 5133,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5158,
+ key.offset: 5145,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5163,
+ key.offset: 5150,
key.length: 29
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5200,
+ key.offset: 5187,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5206,
+ key.offset: 5193,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5211,
+ key.offset: 5198,
key.length: 13
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5232,
+ key.offset: 5219,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5237,
+ key.offset: 5224,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5257,
+ key.offset: 5244,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5267,
+ key.offset: 5254,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5272,
+ key.offset: 5259,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5292,
+ key.offset: 5279,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5302,
+ key.offset: 5289,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5307,
+ key.offset: 5294,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5328,
+ key.offset: 5315,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5338,
+ key.offset: 5325,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5343,
+ key.offset: 5330,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5363,
+ key.offset: 5350,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5370,
+ key.offset: 5357,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5380,
+ key.offset: 5367,
key.length: 13
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5396,
+ key.offset: 5383,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5402,
+ key.offset: 5389,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
+ key.offset: 5393,
+ key.length: 11
+ },
+ {
+ key.kind: source.lang.swift.ref.struct,
+ key.name: "Int32",
+ key.usr: "s:s5Int32V",
key.offset: 5406,
+ key.length: 5
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
+ key.offset: 5414,
+ key.length: 3
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
+ key.offset: 5420,
+ key.length: 3
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.identifier,
+ key.offset: 5424,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5419,
- key.length: 5
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5427,
- key.length: 3
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5433,
- key.length: 3
- },
- {
- key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 5437,
+ key.length: 5
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
+ key.offset: 5445,
+ key.length: 3
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
+ key.offset: 5451,
+ key.length: 3
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.identifier,
+ key.offset: 5455,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5450,
- key.length: 5
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5458,
- key.length: 3
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5464,
- key.length: 3
- },
- {
- key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 5468,
- key.length: 11
- },
- {
- key.kind: source.lang.swift.ref.struct,
- key.name: "Int32",
- key.usr: "s:s5Int32V",
- key.offset: 5481,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5489,
+ key.offset: 5476,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5495,
+ key.offset: 5482,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5499,
+ key.offset: 5486,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt32",
key.usr: "s:s6UInt32V",
- key.offset: 5512,
+ key.offset: 5499,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5521,
+ key.offset: 5508,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5527,
+ key.offset: 5514,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5531,
+ key.offset: 5518,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt64",
key.usr: "s:s6UInt64V",
- key.offset: 5544,
+ key.offset: 5531,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5553,
+ key.offset: 5540,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5559,
+ key.offset: 5546,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
+ key.offset: 5550,
+ key.length: 11
+ },
+ {
+ key.kind: source.lang.swift.ref.typealias,
+ key.name: "typedef_int_t",
+ key.usr: "c:Foo.h@T@typedef_int_t",
key.offset: 5563,
+ key.length: 13
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
+ key.offset: 5579,
+ key.length: 3
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
+ key.offset: 5585,
+ key.length: 3
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.identifier,
+ key.offset: 5589,
key.length: 11
},
{
key.kind: source.lang.swift.ref.typealias,
key.name: "typedef_int_t",
key.usr: "c:Foo.h@T@typedef_int_t",
- key.offset: 5576,
- key.length: 13
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5592,
- key.length: 3
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5598,
- key.length: 3
- },
- {
- key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 5602,
- key.length: 11
- },
- {
- key.kind: source.lang.swift.ref.typealias,
- key.name: "typedef_int_t",
- key.usr: "c:Foo.h@T@typedef_int_t",
- key.offset: 5615,
key.length: 13
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5631,
+ key.offset: 5618,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5637,
+ key.offset: 5624,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5641,
+ key.offset: 5628,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int8",
key.usr: "s:s4Int8V",
- key.offset: 5654,
+ key.offset: 5641,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5661,
+ key.offset: 5648,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5667,
+ key.offset: 5654,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5671,
+ key.offset: 5658,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5684,
+ key.offset: 5671,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5692,
+ key.offset: 5679,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5698,
+ key.offset: 5685,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5702,
+ key.offset: 5689,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int16",
key.usr: "s:s5Int16V",
- key.offset: 5716,
+ key.offset: 5703,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5724,
+ key.offset: 5711,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5730,
+ key.offset: 5717,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5734,
+ key.offset: 5721,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int",
key.usr: "s:Si",
- key.offset: 5748,
+ key.offset: 5735,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5754,
+ key.offset: 5741,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5760,
+ key.offset: 5747,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5764,
+ key.offset: 5751,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5778,
+ key.offset: 5765,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5786,
+ key.offset: 5773,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5792,
+ key.offset: 5779,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5796,
+ key.offset: 5783,
key.length: 13
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5811,
+ key.offset: 5798,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5819,
+ key.offset: 5806,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5825,
+ key.offset: 5812,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5829,
+ key.offset: 5816,
key.length: 18
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt64",
key.usr: "s:s6UInt64V",
- key.offset: 5849,
+ key.offset: 5836,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5858,
+ key.offset: 5845,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5864,
+ key.offset: 5851,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5868,
+ key.offset: 5855,
key.length: 16
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt32",
key.usr: "s:s6UInt32V",
- key.offset: 5886,
+ key.offset: 5873,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5895,
+ key.offset: 5882,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5901,
+ key.offset: 5888,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5905,
+ key.offset: 5892,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5924,
+ key.offset: 5911,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5932,
+ key.offset: 5919,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5938,
+ key.offset: 5925,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5942,
+ key.offset: 5929,
key.length: 17
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 5961,
+ key.offset: 5948,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5969,
+ key.offset: 5956,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5975,
+ key.offset: 5962,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 5980,
+ key.offset: 5967,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 5999,
+ key.offset: 5986,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6004,
+ key.offset: 5991,
key.length: 21
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6028,
+ key.offset: 6015,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6035,
+ key.offset: 6022,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6058,
+ key.offset: 6045,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6062,
+ key.offset: 6049,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 6065,
+ key.offset: 6052,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6076,
+ key.offset: 6063,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6088,
+ key.offset: 6075,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 6093,
+ key.offset: 6080,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 6095,
+ key.offset: 6082,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 6098,
+ key.offset: 6085,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6107,
+ key.offset: 6094,
key.length: 9
},
{
key.kind: source.lang.swift.ref.class,
key.name: "FooClassBase",
key.usr: "c:objc(cs)FooClassBase",
- key.offset: 6117,
+ key.offset: 6104,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6137,
+ key.offset: 6124,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6142,
+ key.offset: 6129,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6162,
+ key.offset: 6149,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6169,
+ key.offset: 6156,
key.length: 9
},
{
key.kind: source.lang.swift.ref.class,
key.name: "FooClassBase",
key.usr: "c:objc(cs)FooClassBase",
- key.offset: 6179,
+ key.offset: 6166,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6199,
+ key.offset: 6186,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6204,
+ key.offset: 6191,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6224,
+ key.offset: 6211,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6234,
+ key.offset: 6221,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6239,
+ key.offset: 6226,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6260,
+ key.offset: 6247,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6267,
+ key.offset: 6254,
key.length: 9
},
{
key.kind: source.lang.swift.ref.class,
key.name: "FooClassBase",
key.usr: "c:objc(cs)FooClassBase",
- key.offset: 6277,
+ key.offset: 6264,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6297,
+ key.offset: 6284,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6302,
+ key.offset: 6289,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6322,
+ key.offset: 6309,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6329,
+ key.offset: 6316,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6338,
+ key.offset: 6325,
key.length: 13
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6356,
+ key.offset: 6343,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6362,
+ key.offset: 6349,
key.length: 21
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "_InternalProt",
key.usr: "c:objc(pl)_InternalProt",
- key.offset: 6386,
+ key.offset: 6373,
key.length: 13
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6404,
+ key.offset: 6391,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6410,
+ key.offset: 6397,
key.length: 25
},
{
key.kind: source.lang.swift.ref.class,
key.name: "FooClassBase",
key.usr: "c:objc(cs)FooClassBase",
- key.offset: 6438,
+ key.offset: 6425,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 6458,
+ key.offset: 6445,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6474,
+ key.offset: 6461,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6478,
+ key.offset: 6465,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
- key.offset: 6490,
+ key.offset: 6477,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 6506,
+ key.offset: 6493,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6522,
+ key.offset: 6509,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6526,
+ key.offset: 6513,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
- key.offset: 6544,
+ key.offset: 6531,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6560,
+ key.offset: 6547,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6564,
+ key.offset: 6551,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6576,
+ key.offset: 6563,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6586,
+ key.offset: 6573,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6590,
+ key.offset: 6577,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6601,
+ key.offset: 6588,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6611,
+ key.offset: 6598,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6615,
+ key.offset: 6602,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6625,
+ key.offset: 6612,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 6635,
+ key.offset: 6622,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6640,
+ key.offset: 6627,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6644,
+ key.offset: 6631,
key.length: 7
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
- key.offset: 6653,
+ key.offset: 6640,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6669,
+ key.offset: 6656,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6673,
+ key.offset: 6660,
key.length: 6
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 6681,
+ key.offset: 6668,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6692,
+ key.offset: 6679,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6697,
+ key.offset: 6684,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6717,
+ key.offset: 6704,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6727,
+ key.offset: 6714,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6732,
+ key.offset: 6719,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6752,
+ key.offset: 6739,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6762,
+ key.offset: 6749,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6767,
+ key.offset: 6754,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6788,
+ key.offset: 6775,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6798,
+ key.offset: 6785,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6803,
+ key.offset: 6790,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6823,
+ key.offset: 6810,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6830,
+ key.offset: 6817,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6834,
+ key.offset: 6821,
key.length: 7
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6846,
+ key.offset: 6833,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6852,
+ key.offset: 6839,
key.length: 21
},
{
key.kind: source.lang.swift.ref.class,
key.name: "FooClassBase",
key.usr: "c:objc(cs)FooClassBase",
- key.offset: 6876,
+ key.offset: 6863,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 6896,
+ key.offset: 6883,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6908,
+ key.offset: 6895,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 6914,
+ key.offset: 6901,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 6918,
+ key.offset: 6905,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 6921,
+ key.offset: 6908,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6933,
+ key.offset: 6920,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6938,
+ key.offset: 6925,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6957,
+ key.offset: 6944,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6962,
+ key.offset: 6949,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 6986,
+ key.offset: 6973,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 6991,
+ key.offset: 6978,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7009,
+ key.offset: 6996,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7014,
+ key.offset: 7001,
key.length: 22
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7044,
+ key.offset: 7031,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7049,
+ key.offset: 7036,
key.length: 22
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7079,
+ key.offset: 7066,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7084,
+ key.offset: 7071,
key.length: 21
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7113,
+ key.offset: 7100,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7118,
+ key.offset: 7105,
key.length: 23
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7149,
+ key.offset: 7136,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7154,
+ key.offset: 7141,
key.length: 25
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7187,
+ key.offset: 7174,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7192,
+ key.offset: 7179,
key.length: 25
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7225,
+ key.offset: 7212,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7230,
+ key.offset: 7217,
key.length: 24
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7262,
+ key.offset: 7249,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7267,
+ key.offset: 7254,
key.length: 26
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7301,
+ key.offset: 7288,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7306,
+ key.offset: 7293,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7326,
+ key.offset: 7313,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7336,
+ key.offset: 7323,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7341,
+ key.offset: 7328,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7361,
+ key.offset: 7348,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7371,
+ key.offset: 7358,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7376,
+ key.offset: 7363,
key.length: 15
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7397,
+ key.offset: 7384,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7407,
+ key.offset: 7394,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7412,
+ key.offset: 7399,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7432,
+ key.offset: 7419,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7439,
+ key.offset: 7426,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7445,
+ key.offset: 7432,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7459,
+ key.offset: 7446,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7464,
+ key.offset: 7451,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 7481,
+ key.offset: 7468,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 7483,
+ key.offset: 7470,
key.length: 1
},
{
key.kind: source.lang.swift.ref.class,
key.name: "FooCFType",
key.usr: "c:Foo.h@T@FooCFTypeRef",
- key.offset: 7486,
+ key.offset: 7473,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7498,
+ key.offset: 7485,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7503,
+ key.offset: 7490,
key.length: 21
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int",
key.usr: "s:Si",
- key.offset: 7527,
+ key.offset: 7514,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7538,
+ key.offset: 7525,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7543,
+ key.offset: 7530,
key.length: 13
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7562,
+ key.offset: 7549,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7567,
+ key.offset: 7554,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 7583,
+ key.offset: 7570,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7594,
+ key.offset: 7581,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7598,
+ key.offset: 7585,
key.length: 9
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int",
key.usr: "s:Si",
- key.offset: 7609,
+ key.offset: 7596,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7615,
+ key.offset: 7602,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
- key.offset: 7626,
+ key.offset: 7613,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7637,
+ key.offset: 7624,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7642,
+ key.offset: 7629,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 7647,
+ key.offset: 7634,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 7652,
+ key.offset: 7639,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7660,
+ key.offset: 7647,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Hasher",
key.usr: "s:s6HasherV",
+ key.offset: 7653,
+ key.length: 6
+ },
+ {
+ key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 7666,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7679,
- key.length: 6
- },
- {
- key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7686,
+ key.offset: 7673,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 7695,
+ key.offset: 7682,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 7697,
+ key.offset: 7684,
key.length: 3
},
{
key.kind: source.lang.swift.ref.enum,
key.name: "ABAuthorizationStatus",
key.usr: "c:@E@ABAuthorizationStatus",
- key.offset: 7702,
+ key.offset: 7689,
key.length: 21
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 7725,
+ key.offset: 7712,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 7727,
+ key.offset: 7714,
key.length: 3
},
{
key.kind: source.lang.swift.ref.enum,
key.name: "ABAuthorizationStatus",
key.usr: "c:@E@ABAuthorizationStatus",
- key.offset: 7732,
+ key.offset: 7719,
key.length: 21
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 7758,
+ key.offset: 7745,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7765,
+ key.offset: 7752,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7770,
+ key.offset: 7757,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 7782,
+ key.offset: 7769,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 7784,
+ key.offset: 7771,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 7787,
+ key.offset: 7774,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
- key.offset: 7797,
+ key.offset: 7784,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7803,
+ key.offset: 7790,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7810,
+ key.offset: 7797,
key.length: 11
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "Equatable",
key.usr: "s:SQ",
- key.offset: 7824,
+ key.offset: 7811,
key.length: 9
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "RawRepresentable",
key.usr: "s:SY",
- key.offset: 7835,
+ key.offset: 7822,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7859,
+ key.offset: 7846,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 7864,
+ key.offset: 7851,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 7866,
+ key.offset: 7853,
key.length: 8
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt32",
key.usr: "s:s6UInt32V",
- key.offset: 7876,
+ key.offset: 7863,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7889,
+ key.offset: 7876,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 7894,
+ key.offset: 7881,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 7903,
+ key.offset: 7890,
key.length: 8
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt32",
key.usr: "s:s6UInt32V",
- key.offset: 7913,
+ key.offset: 7900,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7926,
+ key.offset: 7913,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 7930,
+ key.offset: 7917,
key.length: 8
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt32",
key.usr: "s:s6UInt32V",
- key.offset: 7940,
+ key.offset: 7927,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7952,
+ key.offset: 7939,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 7959,
+ key.offset: 7946,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 7968,
+ key.offset: 7955,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 7970,
+ key.offset: 7957,
key.length: 3
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
- key.offset: 7975,
+ key.offset: 7962,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.argument,
- key.offset: 7988,
+ key.offset: 7975,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
- key.offset: 7990,
+ key.offset: 7977,
key.length: 3
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
- key.offset: 7995,
+ key.offset: 7982,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
- key.offset: 8011,
+ key.offset: 7998,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 8018,
+ key.offset: 8005,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 8022,
+ key.offset: 8009,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
- key.offset: 8036,
+ key.offset: 8023,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 8050,
+ key.offset: 8037,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 8056,
+ key.offset: 8043,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 8060,
+ key.offset: 8047,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
- key.offset: 8074,
+ key.offset: 8061,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 8088,
+ key.offset: 8075,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 8094,
+ key.offset: 8081,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
- key.offset: 8098,
+ key.offset: 8085,
key.length: 25
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int",
key.usr: "s:Si",
- key.offset: 8125,
+ key.offset: 8112,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
- key.offset: 8131,
+ key.offset: 8118,
key.length: 3
}
]
@@ -5275,7 +5273,8 @@
key.kind: source.lang.swift.decl.extension.struct,
key.doc.full_as_xml: "<Other><Name></Name><Declaration>extension FooRuncingOptions</Declaration><CommentParts><Abstract><Para><codeVoice>SetAlgebra</codeVoice> requirements for which default implementations are supplied.</Para></Abstract><Discussion><Note><Para>A type conforming to <codeVoice>SetAlgebra</codeVoice> can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.</Para></Note></Discussion></CommentParts></Other>",
key.offset: 1445,
- key.length: 683,
+ key.length: 670,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:s10SetAlgebraP4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:s10SetAlgebraP4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:s10SetAlgebraP\">SetAlgebra</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
@@ -5302,8 +5301,8 @@
],
key.doc.full_as_xml: "<Function><Name>init(_:)</Name><USR>s:s10SetAlgebraPsEyxqd__ncSTRd__7ElementQyd__ACRtzlufc</USR><Declaration>@inlinable init<S>(_ sequence: __owned S) where S : Sequence, Self.Element == S.Element</Declaration><CommentParts><Abstract><Para>Creates a new set from a finite sequence of items.</Para></Abstract><Parameters><Parameter><Name>sequence</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>The elements to use as members of the new set.</Para></Discussion></Parameter></Parameters><Discussion><Para>Use this initializer to create a new set from an existing sequence, like an array or a range:</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let validIndices = Set(0..<7).subtracting([2, 4, 5])]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(validIndices)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"[6, 0, 1, 3]\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
key.offset: 1480,
- key.length: 100,
- key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>init</syntaxtype.keyword><S>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>sequence</decl.var.parameter.name>: __owned <decl.var.parameter.type>S</decl.var.parameter.type></decl.var.parameter>) <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement>S : <ref.protocol usr=\"s:ST\">Sequence</ref.protocol></decl.generic_type_requirement>, <decl.generic_type_requirement><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct>.<ref.typealias usr=\"s:So17FooRuncingOptionsV7Elementa\">Element</ref.typealias> == S.Element</decl.generic_type_requirement></decl.function.constructor>",
+ key.length: 87,
+ key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>init</syntaxtype.keyword><S>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>sequence</decl.var.parameter.name>: __owned <decl.var.parameter.type>S</decl.var.parameter.type></decl.var.parameter>) <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement>S : <ref.protocol usr=\"s:ST\">Sequence</ref.protocol></decl.generic_type_requirement>, <decl.generic_type_requirement><ref.generic_type_param usr=\"s:s10SetAlgebraP4Selfxmfp\">Self</ref.generic_type_param>.Element == S.Element</decl.generic_type_requirement></decl.function.constructor>",
key.entities: [
{
key.kind: source.lang.swift.decl.var.local,
@@ -5320,7 +5319,7 @@
key.usr: "s:s10SetAlgebraPsE8subtractyyxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s10SetAlgebraPsE8subtractyyxF",
key.doc.full_as_xml: "<Function><Name>subtract(_:)</Name><USR>s:s10SetAlgebraPsE8subtractyyxF</USR><Declaration>@inlinable mutating func subtract(_ other: Self)</Declaration><CommentParts><Abstract><Para>Removes the elements of the given set from this set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A set of the same type as the current set.</Para></Discussion></Parameter></Parameters><Discussion><Para>In the following example, the elements of the <codeVoice>employees</codeVoice> set that are also members of the <codeVoice>neighbors</codeVoice> set are removed. In particular, the names <codeVoice>"Bethany"</codeVoice> and <codeVoice>"Eric"</codeVoice> are removed from <codeVoice>employees</codeVoice>.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[var employees: Set = [\"Alicia\", \"Bethany\", \"Chris\", \"Diana\", \"Eric\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let neighbors: Set = [\"Bethany\", \"Eric\", \"Forlani\", \"Greta\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[employees.subtract(neighbors)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(employees)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"[\"Diana\", \"Chris\", \"Alicia\"]\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 1586,
+ key.offset: 1573,
key.length: 61,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>mutating</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>subtract</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.method.instance>",
key.entities: [
@@ -5328,7 +5327,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "other",
- key.offset: 1629,
+ key.offset: 1616,
key.length: 17
}
]
@@ -5339,7 +5338,7 @@
key.usr: "s:s10SetAlgebraPsE8isSubset2ofSbx_tF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s10SetAlgebraPsE8isSubset2ofSbx_tF",
key.doc.full_as_xml: "<Function><Name>isSubset(of:)</Name><USR>s:s10SetAlgebraPsE8isSubset2ofSbx_tF</USR><Declaration>@inlinable func isSubset(of other: Self) -> Bool</Declaration><CommentParts><Abstract><Para>Returns a Boolean value that indicates whether the set is a subset of another set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A set of the same type as the current set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para><codeVoice>true</codeVoice> if the set is a subset of <codeVoice>other</codeVoice>; otherwise, <codeVoice>false</codeVoice>.</Para></ResultDiscussion><Discussion><Para>Set <emphasis>A</emphasis> is a subset of another set <emphasis>B</emphasis> if every member of <emphasis>A</emphasis> is also a member of <emphasis>B</emphasis>.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let employees: Set = [\"Alicia\", \"Bethany\", \"Chris\", \"Diana\", \"Eric\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let attendees: Set = [\"Alicia\", \"Bethany\", \"Diana\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(attendees.isSubset(of: employees))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 1653,
+ key.offset: 1640,
key.length: 61,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>isSubset</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>of</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5347,7 +5346,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "of",
key.name: "other",
- key.offset: 1688,
+ key.offset: 1675,
key.length: 17
}
]
@@ -5358,7 +5357,7 @@
key.usr: "s:s10SetAlgebraPsE10isSuperset2ofSbx_tF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s10SetAlgebraPsE10isSuperset2ofSbx_tF",
key.doc.full_as_xml: "<Function><Name>isSuperset(of:)</Name><USR>s:s10SetAlgebraPsE10isSuperset2ofSbx_tF</USR><Declaration>@inlinable func isSuperset(of other: Self) -> Bool</Declaration><CommentParts><Abstract><Para>Returns a Boolean value that indicates whether the set is a superset of the given set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A set of the same type as the current set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para><codeVoice>true</codeVoice> if the set is a superset of <codeVoice>other</codeVoice>; otherwise, <codeVoice>false</codeVoice>.</Para></ResultDiscussion><Discussion><Para>Set <emphasis>A</emphasis> is a superset of another set <emphasis>B</emphasis> if every member of <emphasis>B</emphasis> is also a member of <emphasis>A</emphasis>.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let employees: Set = [\"Alicia\", \"Bethany\", \"Chris\", \"Diana\", \"Eric\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let attendees: Set = [\"Alicia\", \"Bethany\", \"Diana\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(employees.isSuperset(of: attendees))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 1720,
+ key.offset: 1707,
key.length: 63,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>isSuperset</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>of</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5366,7 +5365,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "of",
key.name: "other",
- key.offset: 1757,
+ key.offset: 1744,
key.length: 17
}
]
@@ -5377,7 +5376,7 @@
key.usr: "s:s10SetAlgebraPsE10isDisjoint4withSbx_tF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s10SetAlgebraPsE10isDisjoint4withSbx_tF",
key.doc.full_as_xml: "<Function><Name>isDisjoint(with:)</Name><USR>s:s10SetAlgebraPsE10isDisjoint4withSbx_tF</USR><Declaration>@inlinable func isDisjoint(with other: Self) -> Bool</Declaration><CommentParts><Abstract><Para>Returns a Boolean value that indicates whether the set has no members in common with the given set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A set of the same type as the current set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para><codeVoice>true</codeVoice> if the set has no elements in common with <codeVoice>other</codeVoice>; otherwise, <codeVoice>false</codeVoice>.</Para></ResultDiscussion><Discussion><Para>In the following example, the <codeVoice>employees</codeVoice> set is disjoint with the <codeVoice>visitors</codeVoice> set because no name appears in both sets.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let employees: Set = [\"Alicia\", \"Bethany\", \"Chris\", \"Diana\", \"Eric\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let visitors: Set = [\"Marcia\", \"Nathaniel\", \"Olivia\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(employees.isDisjoint(with: visitors))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 1789,
+ key.offset: 1776,
key.length: 65,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>isDisjoint</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>with</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5385,7 +5384,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "with",
key.name: "other",
- key.offset: 1828,
+ key.offset: 1815,
key.length: 17
}
]
@@ -5396,7 +5395,7 @@
key.usr: "s:s10SetAlgebraPsE11subtractingyxxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s10SetAlgebraPsE11subtractingyxxF",
key.doc.full_as_xml: "<Function><Name>subtracting(_:)</Name><USR>s:s10SetAlgebraPsE11subtractingyxxF</USR><Declaration>@inlinable func subtracting(_ other: Self) -> Self</Declaration><CommentParts><Abstract><Para>Returns a new set containing the elements of this set that do not occur in the given set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A set of the same type as the current set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para>A new set.</Para></ResultDiscussion><Discussion><Para>In the following example, the <codeVoice>nonNeighbors</codeVoice> set is made up of the elements of the <codeVoice>employees</codeVoice> set that are not elements of <codeVoice>neighbors</codeVoice>:</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let employees: Set = [\"Alicia\", \"Bethany\", \"Chris\", \"Diana\", \"Eric\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let neighbors: Set = [\"Bethany\", \"Eric\", \"Forlani\", \"Greta\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let nonNeighbors = employees.subtract(neighbors)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(nonNeighbors)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"[\"Diana\", \"Chris\", \"Alicia\"]\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 1860,
+ key.offset: 1847,
key.length: 76,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>subtracting</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5404,7 +5403,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "other",
- key.offset: 1897,
+ key.offset: 1884,
key.length: 17
}
]
@@ -5415,7 +5414,7 @@
key.usr: "s:s10SetAlgebraPsE7isEmptySbvp::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s10SetAlgebraPsE7isEmptySbvp",
key.doc.full_as_xml: "<Other><Name>isEmpty</Name><USR>s:s10SetAlgebraPsE7isEmptySbvp</USR><Declaration>@inlinable var isEmpty: Bool { get }</Declaration><CommentParts><Abstract><Para>A Boolean value that indicates whether the set has no elements.</Para></Abstract></CommentParts></Other>",
- key.offset: 1942,
+ key.offset: 1929,
key.length: 36,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>isEmpty</decl.name>: <decl.var.type><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -5425,7 +5424,7 @@
key.usr: "s:s10SetAlgebraPsE16isStrictSuperset2ofSbx_tF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s10SetAlgebraPsE16isStrictSuperset2ofSbx_tF",
key.doc.full_as_xml: "<Function><Name>isStrictSuperset(of:)</Name><USR>s:s10SetAlgebraPsE16isStrictSuperset2ofSbx_tF</USR><Declaration>@inlinable func isStrictSuperset(of other: Self) -> Bool</Declaration><CommentParts><Abstract><Para>Returns a Boolean value that indicates whether this set is a strict superset of the given set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A set of the same type as the current set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para><codeVoice>true</codeVoice> if the set is a strict superset of <codeVoice>other</codeVoice>; otherwise, <codeVoice>false</codeVoice>.</Para></ResultDiscussion><Discussion><Para>Set <emphasis>A</emphasis> is a strict superset of another set <emphasis>B</emphasis> if every member of <emphasis>B</emphasis> is also a member of <emphasis>A</emphasis> and <emphasis>A</emphasis> contains at least one element that is <emphasis>not</emphasis> a member of <emphasis>B</emphasis>.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let employees: Set = [\"Alicia\", \"Bethany\", \"Chris\", \"Diana\", \"Eric\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let attendees: Set = [\"Alicia\", \"Bethany\", \"Diana\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(employees.isStrictSuperset(of: attendees))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// A set is never a strict superset of itself:]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(employees.isStrictSuperset(of: employees))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"false\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 1984,
+ key.offset: 1971,
key.length: 69,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>isStrictSuperset</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>of</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5433,7 +5432,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "of",
key.name: "other",
- key.offset: 2027,
+ key.offset: 2014,
key.length: 17
}
]
@@ -5444,7 +5443,7 @@
key.usr: "s:s10SetAlgebraPsE14isStrictSubset2ofSbx_tF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s10SetAlgebraPsE14isStrictSubset2ofSbx_tF",
key.doc.full_as_xml: "<Function><Name>isStrictSubset(of:)</Name><USR>s:s10SetAlgebraPsE14isStrictSubset2ofSbx_tF</USR><Declaration>@inlinable func isStrictSubset(of other: Self) -> Bool</Declaration><CommentParts><Abstract><Para>Returns a Boolean value that indicates whether this set is a strict subset of the given set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A set of the same type as the current set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para><codeVoice>true</codeVoice> if the set is a strict subset of <codeVoice>other</codeVoice>; otherwise, <codeVoice>false</codeVoice>.</Para></ResultDiscussion><Discussion><Para>Set <emphasis>A</emphasis> is a strict subset of another set <emphasis>B</emphasis> if every member of <emphasis>A</emphasis> is also a member of <emphasis>B</emphasis> and <emphasis>B</emphasis> contains at least one element that is not a member of <emphasis>A</emphasis>.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let employees: Set = [\"Alicia\", \"Bethany\", \"Chris\", \"Diana\", \"Eric\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let attendees: Set = [\"Alicia\", \"Bethany\", \"Diana\"]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(attendees.isStrictSubset(of: employees))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// A set is never a strict subset of itself:]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(attendees.isStrictSubset(of: attendees))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"false\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 2059,
+ key.offset: 2046,
key.length: 67,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>isStrictSubset</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>of</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5452,7 +5451,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "of",
key.name: "other",
- key.offset: 2100,
+ key.offset: 2087,
key.length: 17
}
]
@@ -5462,8 +5461,9 @@
{
key.kind: source.lang.swift.decl.extension.struct,
key.doc.full_as_xml: "<Other><Name></Name><Declaration>extension FooRuncingOptions</Declaration><CommentParts><Abstract><Para><codeVoice>OptionSet</codeVoice> requirements for which default implementations are supplied.</Para></Abstract><Discussion><Note><Para>A type conforming to <codeVoice>OptionSet</codeVoice> can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.</Para></Note></Discussion></CommentParts></Other>",
- key.offset: 2130,
+ key.offset: 2117,
key.length: 280,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:s9OptionSetP4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:s9OptionSetP4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:s9OptionSetP\">OptionSet</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
@@ -5476,7 +5476,7 @@
key.usr: "s:s9OptionSetPsE5unionyxxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPsE5unionyxxF",
key.doc.full_as_xml: "<Function><Name>union(_:)</Name><USR>s:s9OptionSetPsE5unionyxxF</USR><Declaration>@inlinable func union(_ other: Self) -> Self</Declaration><CommentParts><Abstract><Para>Returns a new option set of the elements contained in this set, in the given set, or in both.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>An option set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para>A new option set made up of the elements contained in this set, in <codeVoice>other</codeVoice>, or in both.</Para></ResultDiscussion><Discussion><Para>This example uses the <codeVoice>union(_:)</codeVoice> method to add two more shipping options to the default set.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let defaultShipping = ShippingOptions.standard]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let memberShipping = defaultShipping.union([.secondDay, .priority])]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(memberShipping.contains(.priority))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 2165,
+ key.offset: 2152,
key.length: 70,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>union</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5484,7 +5484,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "other",
- key.offset: 2196,
+ key.offset: 2183,
key.length: 17
}
]
@@ -5495,7 +5495,7 @@
key.usr: "s:s9OptionSetPsE12intersectionyxxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPsE12intersectionyxxF",
key.doc.full_as_xml: "<Function><Name>intersection(_:)</Name><USR>s:s9OptionSetPsE12intersectionyxxF</USR><Declaration>@inlinable func intersection(_ other: Self) -> Self</Declaration><CommentParts><Abstract><Para>Returns a new option set with only the elements contained in both this set and the given set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>An option set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para>A new option set with only the elements contained in both this set and <codeVoice>other</codeVoice>.</Para></ResultDiscussion><Discussion><Para>This example uses the <codeVoice>intersection(_:)</codeVoice> method to limit the available shipping options to what can be used with a PO Box destination.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[// Can only ship standard or priority to PO Boxes]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let poboxShipping: ShippingOptions = [.standard, .priority]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let memberShipping: ShippingOptions =]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[ [.standard, .priority, .secondDay]]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let availableOptions = memberShipping.intersection(poboxShipping)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(availableOptions.contains(.priority))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(availableOptions.contains(.secondDay))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"false\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 2241,
+ key.offset: 2228,
key.length: 77,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>intersection</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5503,7 +5503,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "other",
- key.offset: 2279,
+ key.offset: 2266,
key.length: 17
}
]
@@ -5514,7 +5514,7 @@
key.usr: "s:s9OptionSetPsE19symmetricDifferenceyxxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPsE19symmetricDifferenceyxxF",
key.doc.full_as_xml: "<Function><Name>symmetricDifference(_:)</Name><USR>s:s9OptionSetPsE19symmetricDifferenceyxxF</USR><Declaration>@inlinable func symmetricDifference(_ other: Self) -> Self</Declaration><CommentParts><Abstract><Para>Returns a new option set with the elements contained in this set or in the given set, but not in both.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>An option set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para>A new option set with only the elements contained in either this set or <codeVoice>other</codeVoice>, but not in both.</Para></ResultDiscussion></CommentParts></Function>",
- key.offset: 2324,
+ key.offset: 2311,
key.length: 84,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>symmetricDifference</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5522,7 +5522,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "other",
- key.offset: 2369,
+ key.offset: 2356,
key.length: 17
}
]
@@ -5537,8 +5537,9 @@
}
],
key.doc.full_as_xml: "<Other><Name></Name><Declaration>extension FooRuncingOptions where Self == Self.Element</Declaration><CommentParts><Abstract><Para><codeVoice>OptionSet</codeVoice> requirements for which default implementations are supplied when <codeVoice>Element == Self</codeVoice>, which is the default.</Para></Abstract><Discussion><Note><Para>A type conforming to <codeVoice>OptionSet</codeVoice> can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.</Para></Note></Discussion></CommentParts></Other>",
- key.offset: 2412,
+ key.offset: 2399,
key.length: 407,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:s9OptionSetPs7ElementQzRszrlE4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:s9OptionSetPs7ElementQzRszrlE4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:s9OptionSetP\">OptionSet</ref.protocol></decl.generic_type_requirement>, <decl.generic_type_requirement><ref.generic_type_param usr=\"s:s9OptionSetPs7ElementQzRszrlE4Selfxmfp\">Self</ref.generic_type_param> == <ref.generic_type_param usr=\"s:s9OptionSetPs7ElementQzRszrlE4Selfxmfp\">Self</ref.generic_type_param>.Element</decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
@@ -5551,7 +5552,7 @@
key.usr: "s:s9OptionSetPs7ElementQzRszrlE8containsySbxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPs7ElementQzRszrlE8containsySbxF",
key.doc.full_as_xml: "<Function><Name>contains(_:)</Name><USR>s:s9OptionSetPs7ElementQzRszrlE8containsySbxF</USR><Declaration>@inlinable func contains(_ member: Self) -> Bool</Declaration><CommentParts><Abstract><Para>Returns a Boolean value that indicates whether a given element is a member of the option set.</Para></Abstract><Parameters><Parameter><Name>member</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>The element to look for in the option set.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para><codeVoice>true</codeVoice> if the option set contains <codeVoice>member</codeVoice>; otherwise, <codeVoice>false</codeVoice>.</Para></ResultDiscussion><Discussion><Para>This example uses the <codeVoice>contains(_:)</codeVoice> method to check whether next-day shipping is in the <codeVoice>availableOptions</codeVoice> instance.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let availableOptions = ShippingOptions.express]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[if availableOptions.contains(.nextDay) {]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[ print(\"Next day shipping available\")]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[}]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"Next day shipping available\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 2447,
+ key.offset: 2434,
key.length: 61,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>contains</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>member</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5559,7 +5560,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "member",
- key.offset: 2482,
+ key.offset: 2469,
key.length: 17
}
]
@@ -5570,7 +5571,7 @@
key.usr: "s:s9OptionSetPs7ElementQzRszrlE6insertySb8inserted_x17memberAfterInserttxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPs7ElementQzRszrlE6insertySb8inserted_x17memberAfterInserttxF",
key.doc.full_as_xml: "<Function><Name>insert(_:)</Name><USR>s:s9OptionSetPs7ElementQzRszrlE6insertySb8inserted_x17memberAfterInserttxF</USR><Declaration>@inlinable mutating func insert(_ newMember: Self.Element) -> (inserted: Bool, memberAfterInsert: Self.Element)</Declaration><CommentParts><Abstract><Para>Adds the given element to the option set if it is not already a member.</Para></Abstract><Parameters><Parameter><Name>newMember</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>The element to insert.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para><codeVoice>(true, newMember)</codeVoice> if <codeVoice>newMember</codeVoice> was not contained in <codeVoice>self</codeVoice>. Otherwise, returns <codeVoice>(false, oldMember)</codeVoice>, where <codeVoice>oldMember</codeVoice> is the member of the set equal to <codeVoice>newMember</codeVoice>.</Para></ResultDiscussion><Discussion><Para>In the following example, the <codeVoice>.secondDay</codeVoice> shipping option is added to the <codeVoice>freeOptions</codeVoice> option set if <codeVoice>purchasePrice</codeVoice> is greater than 50.0. For the <codeVoice>ShippingOptions</codeVoice> declaration, see the <codeVoice>OptionSet</codeVoice> protocol discussion.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let purchasePrice = 87.55]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered><zCodeLineNumbered><![CDATA[var freeOptions: ShippingOptions = [.standard, .priority]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[if purchasePrice > 50 {]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[ freeOptions.insert(.secondDay)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[}]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(freeOptions.contains(.secondDay))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 2514,
+ key.offset: 2501,
key.length: 121,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@discardableResult</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>mutating</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>insert</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>newMember</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><tuple>(<tuple.element><tuple.element.argument_label>inserted</tuple.element.argument_label>: <tuple.element.type><ref.struct usr=\"s:Sb\">Bool</ref.struct></tuple.element.type></tuple.element>, <tuple.element><tuple.element.argument_label>memberAfterInsert</tuple.element.argument_label>: <tuple.element.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></tuple.element.type></tuple.element>)</tuple></decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5578,7 +5579,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "newMember",
- key.offset: 2559,
+ key.offset: 2546,
key.length: 17
}
]
@@ -5589,7 +5590,7 @@
key.usr: "s:s9OptionSetPs7ElementQzRszrlE6removeyxSgxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPs7ElementQzRszrlE6removeyxSgxF",
key.doc.full_as_xml: "<Function><Name>remove(_:)</Name><USR>s:s9OptionSetPs7ElementQzRszrlE6removeyxSgxF</USR><Declaration>@inlinable mutating func remove(_ member: Self.Element) -> Self.Element?</Declaration><CommentParts><Abstract><Para>Removes the given element and all elements subsumed by it.</Para></Abstract><Parameters><Parameter><Name>member</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>The element of the set to remove.</Para></Discussion></Parameter></Parameters><ResultDiscussion><Para>The intersection of <codeVoice>[member]</codeVoice> and the set, if the intersection was nonempty; otherwise, <codeVoice>nil</codeVoice>.</Para></ResultDiscussion><Discussion><Para>In the following example, the <codeVoice>.priority</codeVoice> shipping option is removed from the <codeVoice>options</codeVoice> option set. Attempting to remove the same shipping option a second time results in <codeVoice>nil</codeVoice>, because <codeVoice>options</codeVoice> no longer contains <codeVoice>.priority</codeVoice> as a member.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[var options: ShippingOptions = [.secondDay, .priority]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let priorityOption = options.remove(.priority)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(priorityOption == .priority)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(options.remove(.priority))]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"nil\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing><Para>In the next example, the <codeVoice>.express</codeVoice> element is passed to <codeVoice>remove(_:)</codeVoice>. Although <codeVoice>.express</codeVoice> is not a member of <codeVoice>options</codeVoice>, <codeVoice>.express</codeVoice> subsumes the remaining <codeVoice>.secondDay</codeVoice> element of the option set. Therefore, <codeVoice>options</codeVoice> is emptied and the intersection between <codeVoice>.express</codeVoice> and <codeVoice>options</codeVoice> is returned.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[let expressOption = options.remove(.express)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(expressOption == .express)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"false\"]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(expressOption == .secondDay)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 2641,
+ key.offset: 2628,
key.length: 82,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@discardableResult</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>mutating</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>remove</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>member</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct>?</decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5597,7 +5598,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "member",
- key.offset: 2683,
+ key.offset: 2670,
key.length: 17
}
]
@@ -5608,7 +5609,7 @@
key.usr: "s:s9OptionSetPs7ElementQzRszrlE6update4withxSgx_tF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPs7ElementQzRszrlE6update4withxSgx_tF",
key.doc.full_as_xml: "<Function><Name>update(with:)</Name><USR>s:s9OptionSetPs7ElementQzRszrlE6update4withxSgx_tF</USR><Declaration>@inlinable mutating func update(with newMember: Self.Element) -> Self.Element?</Declaration><CommentParts><Abstract><Para>Inserts the given element into the set.</Para></Abstract><ResultDiscussion><Para>The intersection of <codeVoice>[newMember]</codeVoice> and the set if the intersection was nonempty; otherwise, <codeVoice>nil</codeVoice>.</Para></ResultDiscussion><Discussion><Para>If <codeVoice>newMember</codeVoice> is not contained in the set but subsumes current members of the set, the subsumed members are returned.</Para><CodeListing language=\"swift\"><zCodeLineNumbered><![CDATA[var options: ShippingOptions = [.secondDay, .priority]]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[let replaced = options.update(with: .express)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[print(replaced == .secondDay)]]></zCodeLineNumbered><zCodeLineNumbered><![CDATA[// Prints \"true\"]]></zCodeLineNumbered><zCodeLineNumbered></zCodeLineNumbered></CodeListing></Discussion></CommentParts></Function>",
- key.offset: 2729,
+ key.offset: 2716,
key.length: 88,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@discardableResult</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>mutating</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>update</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>with</decl.var.parameter.argument_label> <decl.var.parameter.name>newMember</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct>?</decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -5616,7 +5617,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "with",
key.name: "newMember",
- key.offset: 2777,
+ key.offset: 2764,
key.length: 17
}
]
@@ -5631,8 +5632,9 @@
}
],
key.doc.full_as_xml: "<Other><Name></Name><Declaration>extension FooRuncingOptions where Self.RawValue : FixedWidthInteger</Declaration><CommentParts><Abstract><Para><codeVoice>OptionSet</codeVoice> requirements for which default implementations are supplied when <codeVoice>RawValue</codeVoice> conforms to <codeVoice>FixedWidthInteger</codeVoice>, which is the usual case. Each distinct bit of an option set’s <codeVoice>.rawValue</codeVoice> corresponds to a disjoint value of the <codeVoice>OptionSet</codeVoice>.</Para></Abstract><Discussion><Note><Para>A type conforming to <codeVoice>OptionSet</codeVoice> can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.</Para></Note><List-Bullet><Item><Para><codeVoice>union</codeVoice> is implemented as a bitwise “or” (<codeVoice>|</codeVoice>) of <codeVoice>rawValue</codeVoice>s</Para></Item><Item><Para><codeVoice>intersection</codeVoice> is implemented as a bitwise “and” (<codeVoice>&</codeVoice>) of <codeVoice>rawValue</codeVoice>s</Para></Item><Item><Para><codeVoice>symmetricDifference</codeVoice> is implemented as a bitwise “exclusive or” (<codeVoice>^</codeVoice>) of <codeVoice>rawValue</codeVoice>s</Para></Item></List-Bullet></Discussion></CommentParts></Other>",
- key.offset: 2821,
+ key.offset: 2808,
key.length: 279,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:s9OptionSetP\">OptionSet</ref.protocol></decl.generic_type_requirement>, <decl.generic_type_requirement><ref.generic_type_param usr=\"s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE4Selfxmfp\">Self</ref.generic_type_param>.RawValue : <ref.protocol usr=\"s:s17FixedWidthIntegerP\">FixedWidthInteger</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.struct,
key.name: "FooRuncingOptions",
@@ -5645,7 +5647,7 @@
key.usr: "s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlExycfc::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlExycfc",
key.doc.full_as_xml: "<Function><Name>init()</Name><USR>s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlExycfc</USR><Declaration>@inlinable init()</Declaration><CommentParts><Abstract><Para>Creates an empty option set.</Para></Abstract><Discussion><Para>This initializer creates an option set with a raw value of zero.</Para></Discussion></CommentParts></Function>",
- key.offset: 2856,
+ key.offset: 2843,
key.length: 17,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>init</syntaxtype.keyword>()</decl.function.constructor>"
},
@@ -5655,7 +5657,7 @@
key.usr: "s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE9formUnionyyxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE9formUnionyyxF",
key.doc.full_as_xml: "<Function><Name>formUnion(_:)</Name><USR>s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE9formUnionyyxF</USR><Declaration>@inlinable mutating func formUnion(_ other: Self)</Declaration><CommentParts><Abstract><Para>Inserts the elements of another set into this option set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>An option set.</Para></Discussion></Parameter></Parameters><Discussion><Para>This method is implemented as a <codeVoice>|</codeVoice> (bitwise OR) operation on the two sets’ raw values.</Para></Discussion></CommentParts></Function>",
- key.offset: 2879,
+ key.offset: 2866,
key.length: 62,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>mutating</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>formUnion</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.method.instance>",
key.entities: [
@@ -5663,7 +5665,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "other",
- key.offset: 2923,
+ key.offset: 2910,
key.length: 17
}
]
@@ -5674,7 +5676,7 @@
key.usr: "s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE16formIntersectionyyxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE16formIntersectionyyxF",
key.doc.full_as_xml: "<Function><Name>formIntersection(_:)</Name><USR>s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE16formIntersectionyyxF</USR><Declaration>@inlinable mutating func formIntersection(_ other: Self)</Declaration><CommentParts><Abstract><Para>Removes all elements of this option set that are not also present in the given set.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>An option set.</Para></Discussion></Parameter></Parameters><Discussion><Para>This method is implemented as a <codeVoice>&</codeVoice> (bitwise AND) operation on the two sets’ raw values.</Para></Discussion></CommentParts></Function>",
- key.offset: 2947,
+ key.offset: 2934,
key.length: 69,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>mutating</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>formIntersection</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.method.instance>",
key.entities: [
@@ -5682,7 +5684,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "other",
- key.offset: 2998,
+ key.offset: 2985,
key.length: 17
}
]
@@ -5693,7 +5695,7 @@
key.usr: "s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE23formSymmetricDifferenceyyxF::SYNTHESIZED::c:@E@FooRuncingOptions",
key.original_usr: "s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE23formSymmetricDifferenceyyxF",
key.doc.full_as_xml: "<Function><Name>formSymmetricDifference(_:)</Name><USR>s:s9OptionSetPss17FixedWidthInteger8RawValueRpzrlE23formSymmetricDifferenceyyxF</USR><Declaration>@inlinable mutating func formSymmetricDifference(_ other: Self)</Declaration><CommentParts><Abstract><Para>Replaces this set with a new set containing all elements contained in either this set or the given set, but not in both.</Para></Abstract><Parameters><Parameter><Name>other</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>An option set.</Para></Discussion></Parameter></Parameters><Discussion><Para>This method is implemented as a <codeVoice>^</codeVoice> (bitwise XOR) operation on the two sets’ raw values.</Para></Discussion></CommentParts></Function>",
- key.offset: 3022,
+ key.offset: 3009,
key.length: 76,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>mutating</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>formSymmetricDifference</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>other</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooRuncingOptions\">FooRuncingOptions</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.method.instance>",
key.entities: [
@@ -5701,7 +5703,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "other",
- key.offset: 3080,
+ key.offset: 3067,
key.length: 17
}
]
@@ -5712,7 +5714,7 @@
key.kind: source.lang.swift.decl.struct,
key.name: "FooStruct1",
key.usr: "c:@S@FooStruct1",
- key.offset: 3101,
+ key.offset: 3088,
key.length: 105,
key.fully_annotated_decl: "<decl.struct><syntaxtype.keyword>struct</syntaxtype.keyword> <decl.name>FooStruct1</decl.name></decl.struct>",
key.entities: [
@@ -5720,7 +5722,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "x",
key.usr: "c:@S@FooStruct1@FI@x",
- key.offset: 3126,
+ key.offset: 3113,
key.length: 12,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>x</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type></decl.var.instance>"
},
@@ -5728,7 +5730,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "y",
key.usr: "c:@S@FooStruct1@FI@y",
- key.offset: 3144,
+ key.offset: 3131,
key.length: 13,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>y</decl.name>: <decl.var.type><ref.struct usr=\"s:Sd\">Double</ref.struct></decl.var.type></decl.var.instance>"
},
@@ -5736,7 +5738,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init()",
key.usr: "s:So10FooStruct1VABycfc",
- key.offset: 3163,
+ key.offset: 3150,
key.length: 6,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>()</decl.function.constructor>"
},
@@ -5744,7 +5746,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(x:y:)",
key.usr: "s:So10FooStruct1V1x1yABs5Int32V_Sdtcfc",
- key.offset: 3175,
+ key.offset: 3162,
key.length: 29,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>x</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.argument_label>y</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:Sd\">Double</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -5752,14 +5754,14 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "x",
key.name: "x",
- key.offset: 3185,
+ key.offset: 3172,
key.length: 5
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "y",
key.name: "y",
- key.offset: 3197,
+ key.offset: 3184,
key.length: 6
}
]
@@ -5770,7 +5772,7 @@
key.kind: source.lang.swift.decl.typealias,
key.name: "FooStruct1Pointer",
key.usr: "c:Foo.h@T@FooStruct1Pointer",
- key.offset: 3207,
+ key.offset: 3194,
key.length: 62,
key.fully_annotated_decl: "<decl.typealias><syntaxtype.keyword>typealias</syntaxtype.keyword> <decl.name>FooStruct1Pointer</decl.name> = <ref.struct usr=\"s:Sp\">UnsafeMutablePointer</ref.struct><<ref.struct usr=\"c:@S@FooStruct1\">FooStruct1</ref.struct>></decl.typealias>",
key.conforms: [
@@ -5785,7 +5787,7 @@
key.kind: source.lang.swift.decl.struct,
key.name: "FooStruct2",
key.usr: "c:@S@FooStruct2",
- key.offset: 3270,
+ key.offset: 3257,
key.length: 105,
key.fully_annotated_decl: "<decl.struct><syntaxtype.keyword>struct</syntaxtype.keyword> <decl.name>FooStruct2</decl.name></decl.struct>",
key.entities: [
@@ -5793,7 +5795,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "x",
key.usr: "c:@S@FooStruct2@FI@x",
- key.offset: 3295,
+ key.offset: 3282,
key.length: 12,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>x</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type></decl.var.instance>"
},
@@ -5801,7 +5803,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "y",
key.usr: "c:@S@FooStruct2@FI@y",
- key.offset: 3313,
+ key.offset: 3300,
key.length: 13,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>y</decl.name>: <decl.var.type><ref.struct usr=\"s:Sd\">Double</ref.struct></decl.var.type></decl.var.instance>"
},
@@ -5809,7 +5811,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init()",
key.usr: "s:So10FooStruct2VABycfc",
- key.offset: 3332,
+ key.offset: 3319,
key.length: 6,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>()</decl.function.constructor>"
},
@@ -5817,7 +5819,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(x:y:)",
key.usr: "s:So10FooStruct2V1x1yABs5Int32V_Sdtcfc",
- key.offset: 3344,
+ key.offset: 3331,
key.length: 29,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>x</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.argument_label>y</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:Sd\">Double</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -5825,14 +5827,14 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "x",
key.name: "x",
- key.offset: 3354,
+ key.offset: 3341,
key.length: 5
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "y",
key.name: "y",
- key.offset: 3366,
+ key.offset: 3353,
key.length: 6
}
]
@@ -5843,7 +5845,7 @@
key.kind: source.lang.swift.decl.typealias,
key.name: "FooStructTypedef1",
key.usr: "c:Foo.h@T@FooStructTypedef1",
- key.offset: 3376,
+ key.offset: 3363,
key.length: 40,
key.fully_annotated_decl: "<decl.typealias><syntaxtype.keyword>typealias</syntaxtype.keyword> <decl.name>FooStructTypedef1</decl.name> = <ref.struct usr=\"c:@S@FooStruct2\">FooStruct2</ref.struct></decl.typealias>"
},
@@ -5851,7 +5853,7 @@
key.kind: source.lang.swift.decl.struct,
key.name: "FooStructTypedef2",
key.usr: "c:@SA@FooStructTypedef2",
- key.offset: 3417,
+ key.offset: 3404,
key.length: 112,
key.fully_annotated_decl: "<decl.struct><syntaxtype.keyword>struct</syntaxtype.keyword> <decl.name>FooStructTypedef2</decl.name></decl.struct>",
key.entities: [
@@ -5859,7 +5861,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "x",
key.usr: "c:@SA@FooStructTypedef2@FI@x",
- key.offset: 3449,
+ key.offset: 3436,
key.length: 12,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>x</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type></decl.var.instance>"
},
@@ -5867,7 +5869,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "y",
key.usr: "c:@SA@FooStructTypedef2@FI@y",
- key.offset: 3467,
+ key.offset: 3454,
key.length: 13,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>y</decl.name>: <decl.var.type><ref.struct usr=\"s:Sd\">Double</ref.struct></decl.var.type></decl.var.instance>"
},
@@ -5875,7 +5877,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init()",
key.usr: "s:So17FooStructTypedef2aABycfc",
- key.offset: 3486,
+ key.offset: 3473,
key.length: 6,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>()</decl.function.constructor>"
},
@@ -5883,7 +5885,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(x:y:)",
key.usr: "s:So17FooStructTypedef2a1x1yABs5Int32V_Sdtcfc",
- key.offset: 3498,
+ key.offset: 3485,
key.length: 29,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>x</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.argument_label>y</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:Sd\">Double</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -5891,14 +5893,14 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "x",
key.name: "x",
- key.offset: 3508,
+ key.offset: 3495,
key.length: 5
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "y",
key.name: "y",
- key.offset: 3520,
+ key.offset: 3507,
key.length: 6
}
]
@@ -5910,7 +5912,7 @@
key.name: "FooTypedef1",
key.usr: "c:Foo.h@T@FooTypedef1",
key.doc.full_as_xml: "<Typedef file=Foo.h line=\"60\" column=\"13\"><Name>FooTypedef1</Name><USR>c:Foo.h@T@FooTypedef1</USR><Declaration>typealias FooTypedef1 = Int32</Declaration><Abstract><Para> Aaa. FooTypedef1. Bbb.</Para></Abstract></Typedef>",
- key.offset: 3530,
+ key.offset: 3517,
key.length: 29,
key.fully_annotated_decl: "<decl.typealias><syntaxtype.keyword>typealias</syntaxtype.keyword> <decl.name>FooTypedef1</decl.name> = <ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.typealias>",
key.conforms: [
@@ -5936,7 +5938,7 @@
key.name: "fooIntVar",
key.usr: "c:@fooIntVar",
key.doc.full_as_xml: "<Variable file=Foo.h line=\"63\" column=\"12\"><Name>fooIntVar</Name><USR>c:@fooIntVar</USR><Declaration>var fooIntVar: Int32</Declaration><Abstract><Para> Aaa. fooIntVar. Bbb.</Para></Abstract></Variable>",
- key.offset: 3560,
+ key.offset: 3547,
key.length: 20,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>fooIntVar</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type></decl.var.global>"
},
@@ -5945,7 +5947,7 @@
key.name: "fooFunc1(_:)",
key.usr: "c:@F@fooFunc1",
key.doc.full_as_xml: "<Function file=Foo.h line=\"66\" column=\"5\"><Name>fooFunc1</Name><USR>c:@F@fooFunc1</USR><Declaration>func fooFunc1(_ a: Int32) -> Int32</Declaration><Abstract><Para> Aaa. fooFunc1. Bbb.</Para></Abstract></Function>",
- key.offset: 3581,
+ key.offset: 3568,
key.length: 34,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFunc1</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>a</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.function.returntype></decl.function.free>",
key.entities: [
@@ -5953,7 +5955,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "a",
- key.offset: 3600,
+ key.offset: 3587,
key.length: 5
}
]
@@ -5962,14 +5964,14 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "fooFunc1AnonymousParam(_:)",
key.usr: "c:@F@fooFunc1AnonymousParam",
- key.offset: 3616,
+ key.offset: 3603,
key.length: 48,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFunc1AnonymousParam</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.function.returntype></decl.function.free>",
key.entities: [
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
- key.offset: 3649,
+ key.offset: 3636,
key.length: 5
}
]
@@ -5978,7 +5980,7 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "fooFunc3(_:_:_:_:)",
key.usr: "c:@F@fooFunc3",
- key.offset: 3665,
+ key.offset: 3652,
key.length: 94,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFunc3</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>a</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>b</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Sf\">Float</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>c</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Sd\">Double</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>d</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Sp\">UnsafeMutablePointer</ref.struct><<ref.struct usr=\"s:s5Int32V\">Int32</ref.struct>>!</decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.function.returntype></decl.function.free>",
key.entities: [
@@ -5986,28 +5988,28 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "a",
- key.offset: 3684,
+ key.offset: 3671,
key.length: 5
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "b",
- key.offset: 3696,
+ key.offset: 3683,
key.length: 5
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "c",
- key.offset: 3708,
+ key.offset: 3695,
key.length: 6
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "d",
- key.offset: 3721,
+ key.offset: 3708,
key.length: 28
}
]
@@ -6016,7 +6018,7 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "fooFuncWithBlock(_:)",
key.usr: "c:@F@fooFuncWithBlock",
- key.offset: 3760,
+ key.offset: 3747,
key.length: 49,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFuncWithBlock</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>blk</decl.var.parameter.name>: <decl.var.parameter.type>((<decl.var.parameter><decl.var.parameter.type><ref.struct usr=\"s:Sf\">Float</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.function.returntype>)!</decl.var.parameter.type></decl.var.parameter>)</decl.function.free>",
key.entities: [
@@ -6024,7 +6026,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "blk",
- key.offset: 3789,
+ key.offset: 3776,
key.length: 19
}
]
@@ -6033,7 +6035,7 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "fooFuncWithFunctionPointer(_:)",
key.usr: "c:@F@fooFuncWithFunctionPointer",
- key.offset: 3810,
+ key.offset: 3797,
key.length: 60,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFuncWithFunctionPointer</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>fptr</decl.var.parameter.name>: <decl.var.parameter.type>((<decl.var.parameter><decl.var.parameter.type><ref.struct usr=\"s:Sf\">Float</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.function.returntype>)!</decl.var.parameter.type></decl.var.parameter>)</decl.function.free>",
key.entities: [
@@ -6041,7 +6043,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "fptr",
- key.offset: 3850,
+ key.offset: 3837,
key.length: 19
}
]
@@ -6050,7 +6052,7 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "fooFuncNoreturn1()",
key.usr: "c:@F@fooFuncNoreturn1",
- key.offset: 3871,
+ key.offset: 3858,
key.length: 32,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFuncNoreturn1</decl.name>() -> <decl.function.returntype><ref.enum usr=\"s:s5NeverO\">Never</ref.enum></decl.function.returntype></decl.function.free>"
},
@@ -6058,7 +6060,7 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "fooFuncNoreturn2()",
key.usr: "c:@F@fooFuncNoreturn2",
- key.offset: 3904,
+ key.offset: 3891,
key.length: 32,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFuncNoreturn2</decl.name>() -> <decl.function.returntype><ref.enum usr=\"s:s5NeverO\">Never</ref.enum></decl.function.returntype></decl.function.free>"
},
@@ -6067,7 +6069,7 @@
key.name: "fooFuncWithComment1()",
key.usr: "c:@F@fooFuncWithComment1",
key.doc.full_as_xml: "<Function file=Foo.h line=\"89\" column=\"6\"><Name>fooFuncWithComment1</Name><USR>c:@F@fooFuncWithComment1</USR><Declaration>func fooFuncWithComment1()</Declaration><Abstract><Para> Aaa. fooFuncWithComment1. Bbb. Ccc.</Para></Abstract><Discussion><Para> Ddd.</Para></Discussion></Function>",
- key.offset: 3937,
+ key.offset: 3924,
key.length: 26,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFuncWithComment1</decl.name>()</decl.function.free>"
},
@@ -6076,7 +6078,7 @@
key.name: "fooFuncWithComment2()",
key.usr: "c:@F@fooFuncWithComment2",
key.doc.full_as_xml: "<Function file=Foo.h line=\"94\" column=\"6\"><Name>fooFuncWithComment2</Name><USR>c:@F@fooFuncWithComment2</USR><Declaration>func fooFuncWithComment2()</Declaration><Abstract><Para> Aaa. fooFuncWithComment2. Bbb.</Para></Abstract></Function>",
- key.offset: 3964,
+ key.offset: 3951,
key.length: 26,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFuncWithComment2</decl.name>()</decl.function.free>"
},
@@ -6085,7 +6087,7 @@
key.name: "fooFuncWithComment3()",
key.usr: "c:@F@fooFuncWithComment3",
key.doc.full_as_xml: "<Function file=Foo.h line=\"102\" column=\"6\"><Name>fooFuncWithComment3</Name><USR>c:@F@fooFuncWithComment3</USR><Declaration>func fooFuncWithComment3()</Declaration><Abstract><Para> Aaa. fooFuncWithComment3. Bbb.</Para></Abstract><Discussion><Para> Ccc.</Para></Discussion></Function>",
- key.offset: 3991,
+ key.offset: 3978,
key.length: 26,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFuncWithComment3</decl.name>()</decl.function.free>"
},
@@ -6094,7 +6096,7 @@
key.name: "fooFuncWithComment4()",
key.usr: "c:@F@fooFuncWithComment4",
key.doc.full_as_xml: "<Function file=Foo.h line=\"108\" column=\"6\"><Name>fooFuncWithComment4</Name><USR>c:@F@fooFuncWithComment4</USR><Declaration>func fooFuncWithComment4()</Declaration><Abstract><Para> Aaa. fooFuncWithComment4. Bbb.</Para></Abstract><Discussion><Para> Ddd.</Para></Discussion></Function>",
- key.offset: 4018,
+ key.offset: 4005,
key.length: 26,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFuncWithComment4</decl.name>()</decl.function.free>"
},
@@ -6103,7 +6105,7 @@
key.name: "fooFuncWithComment5()",
key.usr: "c:@F@fooFuncWithComment5",
key.doc.full_as_xml: "<Function file=Foo.h line=\"114\" column=\"6\"><Name>fooFuncWithComment5</Name><USR>c:@F@fooFuncWithComment5</USR><Declaration>func fooFuncWithComment5()</Declaration><Abstract><Para> Aaa. fooFuncWithComment5. Bbb. Ccc.</Para></Abstract><Discussion><Para> Ddd.</Para></Discussion></Function>",
- key.offset: 4045,
+ key.offset: 4032,
key.length: 26,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooFuncWithComment5</decl.name>()</decl.function.free>"
},
@@ -6112,7 +6114,7 @@
key.name: "redeclaredInMultipleModulesFunc1(_:)",
key.usr: "c:@F@redeclaredInMultipleModulesFunc1",
key.doc.full_as_xml: "<Function file=Foo.h line=\"118\" column=\"5\"><Name>redeclaredInMultipleModulesFunc1</Name><USR>c:@F@redeclaredInMultipleModulesFunc1</USR><Declaration>func redeclaredInMultipleModulesFunc1(_ a: Int32) -> Int32</Declaration><Abstract><Para> Aaa. redeclaredInMultipleModulesFunc1. Bbb.</Para></Abstract></Function>",
- key.offset: 4072,
+ key.offset: 4059,
key.length: 58,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>redeclaredInMultipleModulesFunc1</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>a</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.function.returntype></decl.function.free>",
key.entities: [
@@ -6120,7 +6122,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "a",
- key.offset: 4115,
+ key.offset: 4102,
key.length: 5
}
]
@@ -6130,7 +6132,7 @@
key.name: "FooProtocolBase",
key.usr: "c:objc(pl)FooProtocolBase",
key.doc.full_as_xml: "<Other file=Foo.h line=\"121\" column=\"11\"><Name>FooProtocolBase</Name><USR>c:objc(pl)FooProtocolBase</USR><Declaration>protocol FooProtocolBase</Declaration><Abstract><Para> Aaa. FooProtocolBase. Bbb.</Para></Abstract></Other>",
- key.offset: 4131,
+ key.offset: 4118,
key.length: 301,
key.fully_annotated_decl: "<decl.protocol><syntaxtype.keyword>protocol</syntaxtype.keyword> <decl.name>FooProtocolBase</decl.name></decl.protocol>",
key.entities: [
@@ -6139,7 +6141,7 @@
key.name: "fooProtoFunc()",
key.usr: "c:objc(pl)FooProtocolBase(im)fooProtoFunc",
key.doc.full_as_xml: "<Function isInstanceMethod=\"1\" file=Foo.h line=\"125\" column=\"1\"><Name>fooProtoFunc</Name><USR>c:objc(pl)FooProtocolBase(im)fooProtoFunc</USR><Declaration>func fooProtoFunc()</Declaration><Abstract><Para> Aaa. fooProtoFunc. Bbb. Ccc.</Para></Abstract></Function>",
- key.offset: 4163,
+ key.offset: 4150,
key.length: 19,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooProtoFunc</decl.name>()</decl.function.method.instance>"
},
@@ -6148,7 +6150,7 @@
key.name: "fooProtoFuncWithExtraIndentation1()",
key.usr: "c:objc(pl)FooProtocolBase(im)fooProtoFuncWithExtraIndentation1",
key.doc.full_as_xml: "<Function isInstanceMethod=\"1\" file=Foo.h line=\"129\" column=\"3\"><Name>fooProtoFuncWithExtraIndentation1</Name><USR>c:objc(pl)FooProtocolBase(im)fooProtoFuncWithExtraIndentation1</USR><Declaration>func fooProtoFuncWithExtraIndentation1()</Declaration><Abstract><Para> Aaa. fooProtoFuncWithExtraIndentation1. Bbb. Ccc.</Para></Abstract></Function>",
- key.offset: 4188,
+ key.offset: 4175,
key.length: 40,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooProtoFuncWithExtraIndentation1</decl.name>()</decl.function.method.instance>"
},
@@ -6157,7 +6159,7 @@
key.name: "fooProtoFuncWithExtraIndentation2()",
key.usr: "c:objc(pl)FooProtocolBase(im)fooProtoFuncWithExtraIndentation2",
key.doc.full_as_xml: "<Function isInstanceMethod=\"1\" file=Foo.h line=\"135\" column=\"3\"><Name>fooProtoFuncWithExtraIndentation2</Name><USR>c:objc(pl)FooProtocolBase(im)fooProtoFuncWithExtraIndentation2</USR><Declaration>func fooProtoFuncWithExtraIndentation2()</Declaration><Abstract><Para> Aaa. fooProtoFuncWithExtraIndentation2. Bbb. Ccc.</Para></Abstract></Function>",
- key.offset: 4234,
+ key.offset: 4221,
key.length: 40,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooProtoFuncWithExtraIndentation2</decl.name>()</decl.function.method.instance>"
},
@@ -6165,7 +6167,7 @@
key.kind: source.lang.swift.decl.function.method.static,
key.name: "fooProtoClassFunc()",
key.usr: "c:objc(pl)FooProtocolBase(cm)fooProtoClassFunc",
- key.offset: 4280,
+ key.offset: 4267,
key.length: 31,
key.fully_annotated_decl: "<decl.function.method.static><syntaxtype.keyword>static</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooProtoClassFunc</decl.name>()</decl.function.method.static>"
},
@@ -6173,7 +6175,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "fooProperty1",
key.usr: "c:objc(pl)FooProtocolBase(py)fooProperty1",
- key.offset: 4317,
+ key.offset: 4304,
key.length: 35,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>fooProperty1</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6181,7 +6183,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "fooProperty2",
key.usr: "c:objc(pl)FooProtocolBase(py)fooProperty2",
- key.offset: 4358,
+ key.offset: 4345,
key.length: 35,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>fooProperty2</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6189,7 +6191,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "fooProperty3",
key.usr: "c:objc(pl)FooProtocolBase(py)fooProperty3",
- key.offset: 4399,
+ key.offset: 4386,
key.length: 31,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>fooProperty3</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
}
@@ -6199,7 +6201,7 @@
key.kind: source.lang.swift.decl.protocol,
key.name: "FooProtocolDerived",
key.usr: "c:objc(pl)FooProtocolDerived",
- key.offset: 4433,
+ key.offset: 4420,
key.length: 49,
key.fully_annotated_decl: "<decl.protocol><syntaxtype.keyword>protocol</syntaxtype.keyword> <decl.name>FooProtocolDerived</decl.name> : <ref.protocol usr=\"c:objc(pl)FooProtocolBase\">FooProtocolBase</ref.protocol></decl.protocol>",
key.conforms: [
@@ -6214,7 +6216,7 @@
key.kind: source.lang.swift.decl.class,
key.name: "FooClassBase",
key.usr: "c:objc(cs)FooClassBase",
- key.offset: 4483,
+ key.offset: 4470,
key.length: 392,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>FooClassBase</decl.name></decl.class>",
key.entities: [
@@ -6222,7 +6224,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "fooBaseInstanceFunc0()",
key.usr: "c:objc(cs)FooClassBase(im)fooBaseInstanceFunc0",
- key.offset: 4509,
+ key.offset: 4496,
key.length: 27,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooBaseInstanceFunc0</decl.name>()</decl.function.method.instance>"
},
@@ -6230,7 +6232,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "fooBaseInstanceFunc1(_:)",
key.usr: "c:objc(cs)FooClassBase(im)fooBaseInstanceFunc1:",
- key.offset: 4542,
+ key.offset: 4529,
key.length: 60,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooBaseInstanceFunc1</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>anObject</decl.var.parameter.name>: <decl.var.parameter.type>Any!</decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.class usr=\"c:objc(cs)FooClassBase\">FooClassBase</ref.class>!</decl.function.returntype></decl.function.method.instance>",
key.entities: [
@@ -6238,7 +6240,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "anObject",
- key.offset: 4580,
+ key.offset: 4567,
key.length: 4
}
]
@@ -6247,7 +6249,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init()",
key.usr: "c:objc(cs)FooClassBase(im)init",
- key.offset: 4608,
+ key.offset: 4595,
key.length: 7,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>!()</decl.function.constructor>"
},
@@ -6255,7 +6257,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(float:)",
key.usr: "c:objc(cs)FooClassBase(im)initWithFloat:",
- key.offset: 4621,
+ key.offset: 4608,
key.length: 33,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>convenience</syntaxtype.keyword> <syntaxtype.keyword>init</syntaxtype.keyword>!(<decl.var.parameter><decl.var.parameter.argument_label>float</decl.var.parameter.argument_label> <decl.var.parameter.name>f</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Sf\">Float</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -6263,7 +6265,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "float",
key.name: "f",
- key.offset: 4648,
+ key.offset: 4635,
key.length: 5
}
]
@@ -6272,7 +6274,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "fooBaseInstanceFuncOverridden()",
key.usr: "c:objc(cs)FooClassBase(im)fooBaseInstanceFuncOverridden",
- key.offset: 4660,
+ key.offset: 4647,
key.length: 36,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooBaseInstanceFuncOverridden</decl.name>()</decl.function.method.instance>"
},
@@ -6280,7 +6282,7 @@
key.kind: source.lang.swift.decl.function.method.class,
key.name: "fooBaseClassFunc0()",
key.usr: "c:objc(cs)FooClassBase(cm)fooBaseClassFunc0",
- key.offset: 4702,
+ key.offset: 4689,
key.length: 30,
key.fully_annotated_decl: "<decl.function.method.class><syntaxtype.keyword>class</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooBaseClassFunc0</decl.name>()</decl.function.method.class>"
},
@@ -6288,7 +6290,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "_internalMeth1()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1",
- key.offset: 4738,
+ key.offset: 4725,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth1</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6296,7 +6298,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "_internalMeth2()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2",
- key.offset: 4773,
+ key.offset: 4760,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth2</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6304,7 +6306,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "nonInternalMeth()",
key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth",
- key.offset: 4808,
+ key.offset: 4795,
key.length: 30,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>nonInternalMeth</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6312,7 +6314,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "_internalMeth3()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3",
- key.offset: 4844,
+ key.offset: 4831,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth3</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
}
@@ -6323,7 +6325,7 @@
key.name: "FooClassDerived",
key.usr: "c:objc(cs)FooClassDerived",
key.doc.full_as_xml: "<Other file=Foo.h line=\"158\" column=\"12\"><Name>FooClassDerived</Name><USR>c:objc(cs)FooClassDerived</USR><Declaration>class FooClassDerived : FooClassBase, FooProtocolDerived</Declaration><Abstract><Para> Aaa. FooClassDerived. Bbb.</Para></Abstract></Other>",
- key.offset: 4876,
+ key.offset: 4863,
key.length: 493,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>FooClassDerived</decl.name> : <ref.class usr=\"c:objc(cs)FooClassBase\">FooClassBase</ref.class>, <ref.protocol usr=\"c:objc(pl)FooProtocolDerived\">FooProtocolDerived</ref.protocol></decl.class>",
key.inherits: [
@@ -6345,7 +6347,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "fooProperty1",
key.usr: "c:objc(cs)FooClassDerived(py)fooProperty1",
- key.offset: 4940,
+ key.offset: 4927,
key.length: 23,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>fooProperty1</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6353,7 +6355,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "fooProperty2",
key.usr: "c:objc(cs)FooClassDerived(py)fooProperty2",
- key.offset: 4969,
+ key.offset: 4956,
key.length: 23,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>fooProperty2</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6361,7 +6363,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "fooProperty3",
key.usr: "c:objc(cs)FooClassDerived(py)fooProperty3",
- key.offset: 4998,
+ key.offset: 4985,
key.length: 31,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>fooProperty3</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6369,7 +6371,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "fooInstanceFunc0()",
key.usr: "c:objc(cs)FooClassDerived(im)fooInstanceFunc0",
- key.offset: 5035,
+ key.offset: 5022,
key.length: 23,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooInstanceFunc0</decl.name>()</decl.function.method.instance>"
},
@@ -6377,7 +6379,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "fooInstanceFunc1(_:)",
key.usr: "c:objc(cs)FooClassDerived(im)fooInstanceFunc1:",
- key.offset: 5064,
+ key.offset: 5051,
key.length: 33,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooInstanceFunc1</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>a</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.method.instance>",
key.entities: [
@@ -6385,7 +6387,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "a",
- key.offset: 5091,
+ key.offset: 5078,
key.length: 5
}
]
@@ -6394,7 +6396,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "fooInstanceFunc2(_:withB:)",
key.usr: "c:objc(cs)FooClassDerived(im)fooInstanceFunc2:withB:",
- key.offset: 5103,
+ key.offset: 5090,
key.length: 49,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooInstanceFunc2</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>a</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.argument_label>withB</decl.var.parameter.argument_label> <decl.var.parameter.name>b</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.method.instance>",
key.entities: [
@@ -6402,14 +6404,14 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "a",
- key.offset: 5130,
+ key.offset: 5117,
key.length: 5
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "withB",
key.name: "b",
- key.offset: 5146,
+ key.offset: 5133,
key.length: 5
}
]
@@ -6418,7 +6420,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "fooBaseInstanceFuncOverridden()",
key.usr: "c:objc(cs)FooClassDerived(im)fooBaseInstanceFuncOverridden",
- key.offset: 5158,
+ key.offset: 5145,
key.length: 36,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooBaseInstanceFuncOverridden</decl.name>()</decl.function.method.instance>",
key.inherits: [
@@ -6433,7 +6435,7 @@
key.kind: source.lang.swift.decl.function.method.class,
key.name: "fooClassFunc0()",
key.usr: "c:objc(cs)FooClassDerived(cm)fooClassFunc0",
- key.offset: 5200,
+ key.offset: 5187,
key.length: 26,
key.fully_annotated_decl: "<decl.function.method.class><syntaxtype.keyword>class</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooClassFunc0</decl.name>()</decl.function.method.class>"
},
@@ -6442,7 +6444,7 @@
key.name: "_internalMeth1()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1::SYNTHESIZED::c:objc(cs)FooClassDerived",
key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth1",
- key.offset: 5232,
+ key.offset: 5219,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth1</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6451,7 +6453,7 @@
key.name: "_internalMeth2()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2::SYNTHESIZED::c:objc(cs)FooClassDerived",
key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth2",
- key.offset: 5267,
+ key.offset: 5254,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth2</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6460,7 +6462,7 @@
key.name: "nonInternalMeth()",
key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth::SYNTHESIZED::c:objc(cs)FooClassDerived",
key.original_usr: "c:objc(cs)FooClassBase(im)nonInternalMeth",
- key.offset: 5302,
+ key.offset: 5289,
key.length: 30,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>nonInternalMeth</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6469,7 +6471,7 @@
key.name: "_internalMeth3()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3::SYNTHESIZED::c:objc(cs)FooClassDerived",
key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth3",
- key.offset: 5338,
+ key.offset: 5325,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth3</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
}
@@ -6479,7 +6481,7 @@
key.kind: source.lang.swift.decl.typealias,
key.name: "typedef_int_t",
key.usr: "c:Foo.h@T@typedef_int_t",
- key.offset: 5370,
+ key.offset: 5357,
key.length: 31,
key.fully_annotated_decl: "<decl.typealias><syntaxtype.keyword>typealias</syntaxtype.keyword> <decl.name>typedef_int_t</decl.name> = <ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.typealias>",
key.conforms: [
@@ -6504,7 +6506,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_1",
key.usr: "c:Foo.h@3720@macro@FOO_MACRO_1",
- key.offset: 5402,
+ key.offset: 5389,
key.length: 30,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_1</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6512,7 +6514,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_2",
key.usr: "c:Foo.h@3742@macro@FOO_MACRO_2",
- key.offset: 5433,
+ key.offset: 5420,
key.length: 30,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_2</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6520,7 +6522,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_3",
key.usr: "c:Foo.h@3764@macro@FOO_MACRO_3",
- key.offset: 5464,
+ key.offset: 5451,
key.length: 30,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_3</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6528,7 +6530,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_4",
key.usr: "c:Foo.h@3828@macro@FOO_MACRO_4",
- key.offset: 5495,
+ key.offset: 5482,
key.length: 31,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_4</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6536,7 +6538,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_5",
key.usr: "c:Foo.h@3860@macro@FOO_MACRO_5",
- key.offset: 5527,
+ key.offset: 5514,
key.length: 31,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_5</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt64V\">UInt64</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6544,7 +6546,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_6",
key.usr: "c:Foo.h@3902@macro@FOO_MACRO_6",
- key.offset: 5559,
+ key.offset: 5546,
key.length: 38,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_6</decl.name>: <decl.var.type><ref.typealias usr=\"c:Foo.h@T@typedef_int_t\">typedef_int_t</ref.typealias></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6552,7 +6554,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_7",
key.usr: "c:Foo.h@3943@macro@FOO_MACRO_7",
- key.offset: 5598,
+ key.offset: 5585,
key.length: 38,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_7</decl.name>: <decl.var.type><ref.typealias usr=\"c:Foo.h@T@typedef_int_t\">typedef_int_t</ref.typealias></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6560,7 +6562,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_8",
key.usr: "c:Foo.h@3984@macro@FOO_MACRO_8",
- key.offset: 5637,
+ key.offset: 5624,
key.length: 29,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_8</decl.name>: <decl.var.type><ref.struct usr=\"s:s4Int8V\">Int8</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6568,7 +6570,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_9",
key.usr: "c:Foo.h@4015@macro@FOO_MACRO_9",
- key.offset: 5667,
+ key.offset: 5654,
key.length: 30,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_9</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6576,7 +6578,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_10",
key.usr: "c:Foo.h@4045@macro@FOO_MACRO_10",
- key.offset: 5698,
+ key.offset: 5685,
key.length: 31,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_10</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int16V\">Int16</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6584,7 +6586,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_11",
key.usr: "c:Foo.h@4079@macro@FOO_MACRO_11",
- key.offset: 5730,
+ key.offset: 5717,
key.length: 29,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_11</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6592,7 +6594,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_OR",
key.usr: "c:Foo.h@4112@macro@FOO_MACRO_OR",
- key.offset: 5760,
+ key.offset: 5747,
key.length: 31,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_OR</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6600,7 +6602,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_AND",
key.usr: "c:Foo.h@4161@macro@FOO_MACRO_AND",
- key.offset: 5792,
+ key.offset: 5779,
key.length: 32,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_AND</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6608,7 +6610,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_BITWIDTH",
key.usr: "c:Foo.h@4211@macro@FOO_MACRO_BITWIDTH",
- key.offset: 5825,
+ key.offset: 5812,
key.length: 38,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_BITWIDTH</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt64V\">UInt64</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6616,7 +6618,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_SIGNED",
key.usr: "c:Foo.h@4266@macro@FOO_MACRO_SIGNED",
- key.offset: 5864,
+ key.offset: 5851,
key.length: 36,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_SIGNED</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6624,7 +6626,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_REDEF_1",
key.usr: "c:Foo.h@4477@macro@FOO_MACRO_REDEF_1",
- key.offset: 5901,
+ key.offset: 5888,
key.length: 36,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_REDEF_1</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6632,7 +6634,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_MACRO_REDEF_2",
key.usr: "c:Foo.h@4534@macro@FOO_MACRO_REDEF_2",
- key.offset: 5938,
+ key.offset: 5925,
key.length: 36,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_MACRO_REDEF_2</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>"
},
@@ -6640,7 +6642,7 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "theLastDeclInFoo()",
key.usr: "c:@F@theLastDeclInFoo",
- key.offset: 5975,
+ key.offset: 5962,
key.length: 23,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>theLastDeclInFoo</decl.name>()</decl.function.free>"
},
@@ -6648,7 +6650,7 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "_internalTopLevelFunc()",
key.usr: "c:@F@_internalTopLevelFunc",
- key.offset: 5999,
+ key.offset: 5986,
key.length: 28,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalTopLevelFunc</decl.name>()</decl.function.free>"
},
@@ -6656,7 +6658,7 @@
key.kind: source.lang.swift.decl.struct,
key.name: "_InternalStruct",
key.usr: "c:@S@_InternalStruct",
- key.offset: 6028,
+ key.offset: 6015,
key.length: 78,
key.fully_annotated_decl: "<decl.struct><syntaxtype.keyword>struct</syntaxtype.keyword> <decl.name>_InternalStruct</decl.name></decl.struct>",
key.entities: [
@@ -6664,7 +6666,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "x",
key.usr: "c:@S@_InternalStruct@FI@x",
- key.offset: 6058,
+ key.offset: 6045,
key.length: 12,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>x</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type></decl.var.instance>"
},
@@ -6672,7 +6674,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init()",
key.usr: "s:So15_InternalStructVABycfc",
- key.offset: 6076,
+ key.offset: 6063,
key.length: 6,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>()</decl.function.constructor>"
},
@@ -6680,7 +6682,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(x:)",
key.usr: "s:So15_InternalStructV1xABs5Int32V_tcfc",
- key.offset: 6088,
+ key.offset: 6075,
key.length: 16,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>x</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -6688,7 +6690,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "x",
key.name: "x",
- key.offset: 6098,
+ key.offset: 6085,
key.length: 5
}
]
@@ -6697,7 +6699,7 @@
},
{
key.kind: source.lang.swift.decl.extension.class,
- key.offset: 6107,
+ key.offset: 6094,
key.length: 61,
key.extends: {
key.kind: source.lang.swift.ref.class,
@@ -6709,7 +6711,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "_internalMeth1()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1",
- key.offset: 6137,
+ key.offset: 6124,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth1</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
}
@@ -6717,7 +6719,7 @@
},
{
key.kind: source.lang.swift.decl.extension.class,
- key.offset: 6169,
+ key.offset: 6156,
key.length: 97,
key.extends: {
key.kind: source.lang.swift.ref.class,
@@ -6729,7 +6731,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "_internalMeth2()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2",
- key.offset: 6199,
+ key.offset: 6186,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth2</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6737,7 +6739,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "nonInternalMeth()",
key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth",
- key.offset: 6234,
+ key.offset: 6221,
key.length: 30,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>nonInternalMeth</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
}
@@ -6745,7 +6747,7 @@
},
{
key.kind: source.lang.swift.decl.extension.class,
- key.offset: 6267,
+ key.offset: 6254,
key.length: 61,
key.extends: {
key.kind: source.lang.swift.ref.class,
@@ -6757,7 +6759,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "_internalMeth3()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3",
- key.offset: 6297,
+ key.offset: 6284,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth3</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
}
@@ -6767,7 +6769,7 @@
key.kind: source.lang.swift.decl.protocol,
key.name: "_InternalProt",
key.usr: "c:objc(pl)_InternalProt",
- key.offset: 6329,
+ key.offset: 6316,
key.length: 26,
key.fully_annotated_decl: "<decl.protocol><syntaxtype.keyword>protocol</syntaxtype.keyword> <decl.name>_InternalProt</decl.name></decl.protocol>"
},
@@ -6775,7 +6777,7 @@
key.kind: source.lang.swift.decl.class,
key.name: "ClassWithInternalProt",
key.usr: "c:objc(cs)ClassWithInternalProt",
- key.offset: 6356,
+ key.offset: 6343,
key.length: 47,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>ClassWithInternalProt</decl.name> : <ref.protocol usr=\"c:objc(pl)_InternalProt\">_InternalProt</ref.protocol></decl.class>",
key.conforms: [
@@ -6790,7 +6792,7 @@
key.kind: source.lang.swift.decl.class,
key.name: "FooClassPropertyOwnership",
key.usr: "c:objc(cs)FooClassPropertyOwnership",
- key.offset: 6404,
+ key.offset: 6391,
key.length: 425,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>FooClassPropertyOwnership</decl.name> : <ref.class usr=\"c:objc(cs)FooClassBase\">FooClassBase</ref.class></decl.class>",
key.inherits: [
@@ -6805,7 +6807,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "assignable",
key.usr: "c:objc(cs)FooClassPropertyOwnership(py)assignable",
- key.offset: 6458,
+ key.offset: 6445,
key.length: 42,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>unowned(unsafe)</syntaxtype.keyword> <syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>assignable</decl.name>: <decl.var.type>AnyObject!</decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6813,7 +6815,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "unsafeAssignable",
key.usr: "c:objc(cs)FooClassPropertyOwnership(py)unsafeAssignable",
- key.offset: 6506,
+ key.offset: 6493,
key.length: 48,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>unowned(unsafe)</syntaxtype.keyword> <syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>unsafeAssignable</decl.name>: <decl.var.type>AnyObject!</decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6821,7 +6823,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "retainable",
key.usr: "c:objc(cs)FooClassPropertyOwnership(py)retainable",
- key.offset: 6560,
+ key.offset: 6547,
key.length: 20,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>retainable</decl.name>: <decl.var.type>Any!</decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6829,7 +6831,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "strongRef",
key.usr: "c:objc(cs)FooClassPropertyOwnership(py)strongRef",
- key.offset: 6586,
+ key.offset: 6573,
key.length: 19,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>strongRef</decl.name>: <decl.var.type>Any!</decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6837,7 +6839,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "copyable",
key.usr: "c:objc(cs)FooClassPropertyOwnership(py)copyable",
- key.offset: 6611,
+ key.offset: 6598,
key.length: 18,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>copyable</decl.name>: <decl.var.type>Any!</decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6845,7 +6847,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "weakRef",
key.usr: "c:objc(cs)FooClassPropertyOwnership(py)weakRef",
- key.offset: 6635,
+ key.offset: 6622,
key.length: 28,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>weak</syntaxtype.keyword> <syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>weakRef</decl.name>: <decl.var.type>AnyObject!</decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6853,7 +6855,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "scalar",
key.usr: "c:objc(cs)FooClassPropertyOwnership(py)scalar",
- key.offset: 6669,
+ key.offset: 6656,
key.length: 17,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>scalar</decl.name>: <decl.var.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> <syntaxtype.keyword>set</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -6862,7 +6864,7 @@
key.name: "_internalMeth1()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1::SYNTHESIZED::c:objc(cs)FooClassPropertyOwnership",
key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth1",
- key.offset: 6692,
+ key.offset: 6679,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth1</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6871,7 +6873,7 @@
key.name: "_internalMeth2()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2::SYNTHESIZED::c:objc(cs)FooClassPropertyOwnership",
key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth2",
- key.offset: 6727,
+ key.offset: 6714,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth2</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6880,7 +6882,7 @@
key.name: "nonInternalMeth()",
key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth::SYNTHESIZED::c:objc(cs)FooClassPropertyOwnership",
key.original_usr: "c:objc(cs)FooClassBase(im)nonInternalMeth",
- key.offset: 6762,
+ key.offset: 6749,
key.length: 30,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>nonInternalMeth</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -6889,7 +6891,7 @@
key.name: "_internalMeth3()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3::SYNTHESIZED::c:objc(cs)FooClassPropertyOwnership",
key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth3",
- key.offset: 6798,
+ key.offset: 6785,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth3</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
}
@@ -6899,7 +6901,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FOO_NIL",
key.usr: "c:Foo.h@5323@macro@FOO_NIL",
- key.offset: 6830,
+ key.offset: 6817,
key.length: 15,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FOO_NIL</decl.name>: <decl.var.type><tuple>()</tuple></decl.var.type></decl.var.global>",
key.attributes: [
@@ -6915,7 +6917,7 @@
key.kind: source.lang.swift.decl.class,
key.name: "FooUnavailableMembers",
key.usr: "c:objc(cs)FooUnavailableMembers",
- key.offset: 6846,
+ key.offset: 6833,
key.length: 592,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>FooUnavailableMembers</decl.name> : <ref.class usr=\"c:objc(cs)FooClassBase\">FooClassBase</ref.class></decl.class>",
key.inherits: [
@@ -6930,7 +6932,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(int:)",
key.usr: "c:objc(cs)FooUnavailableMembers(cm)unavailableMembersWithInt:",
- key.offset: 6896,
+ key.offset: 6883,
key.length: 31,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>convenience</syntaxtype.keyword> <syntaxtype.keyword>init</syntaxtype.keyword>!(<decl.var.parameter><decl.var.parameter.argument_label>int</decl.var.parameter.argument_label> <decl.var.parameter.name>i</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -6938,7 +6940,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "int",
key.name: "i",
- key.offset: 6921,
+ key.offset: 6908,
key.length: 5
}
]
@@ -6947,7 +6949,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "unavailable()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)unavailable",
- key.offset: 6933,
+ key.offset: 6920,
key.length: 18,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>unavailable</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -6963,7 +6965,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "swiftUnavailable()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)swiftUnavailable",
- key.offset: 6957,
+ key.offset: 6944,
key.length: 23,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>swiftUnavailable</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -6978,7 +6980,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "deprecated()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)deprecated",
- key.offset: 6986,
+ key.offset: 6973,
key.length: 17,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>deprecated</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -6994,7 +6996,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "availabilityIntroduced()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityIntroduced",
- key.offset: 7009,
+ key.offset: 6996,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>availabilityIntroduced</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -7009,7 +7011,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "availabilityDeprecated()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityDeprecated",
- key.offset: 7044,
+ key.offset: 7031,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>availabilityDeprecated</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -7028,7 +7030,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "availabilityObsoleted()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityObsoleted",
- key.offset: 7079,
+ key.offset: 7066,
key.length: 28,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>availabilityObsoleted</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -7044,7 +7046,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "availabilityUnavailable()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityUnavailable",
- key.offset: 7113,
+ key.offset: 7100,
key.length: 30,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>availabilityUnavailable</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -7060,7 +7062,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "availabilityIntroducedMsg()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityIntroducedMsg",
- key.offset: 7149,
+ key.offset: 7136,
key.length: 32,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>availabilityIntroducedMsg</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -7076,7 +7078,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "availabilityDeprecatedMsg()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityDeprecatedMsg",
- key.offset: 7187,
+ key.offset: 7174,
key.length: 32,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>availabilityDeprecatedMsg</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -7095,7 +7097,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "availabilityObsoletedMsg()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityObsoletedMsg",
- key.offset: 7225,
+ key.offset: 7212,
key.length: 31,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>availabilityObsoletedMsg</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -7112,7 +7114,7 @@
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "availabilityUnavailableMsg()",
key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityUnavailableMsg",
- key.offset: 7262,
+ key.offset: 7249,
key.length: 33,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>availabilityUnavailableMsg</decl.name>()</decl.function.method.instance>",
key.attributes: [
@@ -7130,7 +7132,7 @@
key.name: "_internalMeth1()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1::SYNTHESIZED::c:objc(cs)FooUnavailableMembers",
key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth1",
- key.offset: 7301,
+ key.offset: 7288,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth1</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -7139,7 +7141,7 @@
key.name: "_internalMeth2()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2::SYNTHESIZED::c:objc(cs)FooUnavailableMembers",
key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth2",
- key.offset: 7336,
+ key.offset: 7323,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth2</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -7148,7 +7150,7 @@
key.name: "nonInternalMeth()",
key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth::SYNTHESIZED::c:objc(cs)FooUnavailableMembers",
key.original_usr: "c:objc(cs)FooClassBase(im)nonInternalMeth",
- key.offset: 7371,
+ key.offset: 7358,
key.length: 30,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>nonInternalMeth</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
},
@@ -7157,7 +7159,7 @@
key.name: "_internalMeth3()",
key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3::SYNTHESIZED::c:objc(cs)FooUnavailableMembers",
key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth3",
- key.offset: 7407,
+ key.offset: 7394,
key.length: 29,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>_internalMeth3</decl.name>() -> <decl.function.returntype>Any!</decl.function.returntype></decl.function.method.instance>"
}
@@ -7167,7 +7169,7 @@
key.kind: source.lang.swift.decl.class,
key.name: "FooCFType",
key.usr: "c:Foo.h@T@FooCFTypeRef",
- key.offset: 7439,
+ key.offset: 7426,
key.length: 19,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>FooCFType</decl.name></decl.class>"
},
@@ -7175,14 +7177,14 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "FooCFTypeRelease(_:)",
key.usr: "c:@F@FooCFTypeRelease",
- key.offset: 7459,
+ key.offset: 7446,
key.length: 38,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>FooCFTypeRelease</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.class usr=\"c:Foo.h@T@FooCFTypeRef\">FooCFType</ref.class>!</decl.var.parameter.type></decl.var.parameter>)</decl.function.free>",
key.entities: [
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
- key.offset: 7486,
+ key.offset: 7473,
key.length: 10
}
],
@@ -7199,7 +7201,7 @@
key.kind: source.lang.swift.decl.enum,
key.name: "ABAuthorizationStatus",
key.usr: "c:@E@ABAuthorizationStatus",
- key.offset: 7498,
+ key.offset: 7485,
key.length: 266,
key.fully_annotated_decl: "<decl.enum><syntaxtype.keyword>enum</syntaxtype.keyword> <decl.name>ABAuthorizationStatus</decl.name> : <ref.struct usr=\"s:Si\">Int</ref.struct></decl.enum>",
key.inherits: [
@@ -7214,7 +7216,7 @@
key.kind: source.lang.swift.decl.enumelement,
key.name: "notDetermined",
key.usr: "c:@E@ABAuthorizationStatus@kABAuthorizationStatusNotDetermined",
- key.offset: 7538,
+ key.offset: 7525,
key.length: 18,
key.fully_annotated_decl: "<decl.enumelement><syntaxtype.keyword>case</syntaxtype.keyword> <decl.name>notDetermined</decl.name> = <syntaxtype.number>0</syntaxtype.number></decl.enumelement>",
key.attributes: [
@@ -7229,7 +7231,7 @@
key.kind: source.lang.swift.decl.enumelement,
key.name: "restricted",
key.usr: "c:@E@ABAuthorizationStatus@kABAuthorizationStatusRestricted",
- key.offset: 7562,
+ key.offset: 7549,
key.length: 15,
key.fully_annotated_decl: "<decl.enumelement><syntaxtype.keyword>case</syntaxtype.keyword> <decl.name>restricted</decl.name> = <syntaxtype.number>1</syntaxtype.number></decl.enumelement>",
key.attributes: [
@@ -7245,7 +7247,7 @@
key.name: "hashValue",
key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp::SYNTHESIZED::c:@E@ABAuthorizationStatus",
key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp",
- key.offset: 7583,
+ key.offset: 7570,
key.length: 37,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>hashValue</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -7254,7 +7256,7 @@
key.name: "hash(into:)",
key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF::SYNTHESIZED::c:@E@ABAuthorizationStatus",
key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF",
- key.offset: 7626,
+ key.offset: 7613,
key.length: 47,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>hash</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>into</decl.var.parameter.argument_label> <decl.var.parameter.name>hasher</decl.var.parameter.name>: inout <decl.var.parameter.type><ref.struct usr=\"s:s6HasherV\">Hasher</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.method.instance>",
key.entities: [
@@ -7262,7 +7264,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "into",
key.name: "hasher",
- key.offset: 7666,
+ key.offset: 7653,
key.length: 6
}
]
@@ -7272,7 +7274,7 @@
key.name: "!=(_:_:)",
key.usr: "s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::c:@E@ABAuthorizationStatus",
key.original_usr: "s:SQsE2neoiySbx_xtFZ",
- key.offset: 7679,
+ key.offset: 7666,
key.length: 83,
key.fully_annotated_decl: "<decl.function.operator.infix><syntaxtype.keyword>static</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>!= </decl.name>(<decl.var.parameter><decl.var.parameter.name>lhs</decl.var.parameter.name>: <decl.var.parameter.type><ref.enum usr=\"c:@E@ABAuthorizationStatus\">ABAuthorizationStatus</ref.enum></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.name>rhs</decl.var.parameter.name>: <decl.var.parameter.type><ref.enum usr=\"c:@E@ABAuthorizationStatus\">ABAuthorizationStatus</ref.enum></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.function.returntype></decl.function.operator.infix>",
key.entities: [
@@ -7280,14 +7282,14 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "lhs",
- key.offset: 7702,
+ key.offset: 7689,
key.length: 21
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "rhs",
- key.offset: 7732,
+ key.offset: 7719,
key.length: 21
}
]
@@ -7306,7 +7308,7 @@
key.kind: source.lang.swift.decl.function.free,
key.name: "fooSubFunc1(_:)",
key.usr: "c:@F@fooSubFunc1",
- key.offset: 7765,
+ key.offset: 7752,
key.length: 37,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooSubFunc1</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>a</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.function.returntype></decl.function.free>",
key.entities: [
@@ -7314,7 +7316,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "a",
- key.offset: 7787,
+ key.offset: 7774,
key.length: 5
}
],
@@ -7324,7 +7326,7 @@
key.kind: source.lang.swift.decl.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
- key.offset: 7803,
+ key.offset: 7790,
key.length: 214,
key.fully_annotated_decl: "<decl.struct><syntaxtype.keyword>struct</syntaxtype.keyword> <decl.name>FooSubEnum1</decl.name> : <ref.protocol usr=\"s:SQ\">Equatable</ref.protocol>, <ref.protocol usr=\"s:SY\">RawRepresentable</ref.protocol></decl.struct>",
key.conforms: [
@@ -7344,7 +7346,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(_:)",
key.usr: "s:So11FooSubEnum1VyABs6UInt32Vcfc",
- key.offset: 7859,
+ key.offset: 7846,
key.length: 24,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>rawValue</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -7352,7 +7354,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "rawValue",
- key.offset: 7876,
+ key.offset: 7863,
key.length: 6
}
]
@@ -7361,7 +7363,7 @@
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(rawValue:)",
key.usr: "s:So11FooSubEnum1V8rawValueABs6UInt32V_tcfc",
- key.offset: 7889,
+ key.offset: 7876,
key.length: 31,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>rawValue</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -7369,7 +7371,7 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "rawValue",
key.name: "rawValue",
- key.offset: 7913,
+ key.offset: 7900,
key.length: 6
}
]
@@ -7378,7 +7380,7 @@
key.kind: source.lang.swift.decl.var.instance,
key.name: "rawValue",
key.usr: "s:So11FooSubEnum1V8rawValues6UInt32Vvp",
- key.offset: 7926,
+ key.offset: 7913,
key.length: 20,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>rawValue</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.type></decl.var.instance>"
},
@@ -7387,7 +7389,7 @@
key.name: "!=(_:_:)",
key.usr: "s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::c:@E@FooSubEnum1",
key.original_usr: "s:SQsE2neoiySbx_xtFZ",
- key.offset: 7952,
+ key.offset: 7939,
key.length: 63,
key.fully_annotated_decl: "<decl.function.operator.infix><syntaxtype.keyword>static</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>!= </decl.name>(<decl.var.parameter><decl.var.parameter.name>lhs</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooSubEnum1\">FooSubEnum1</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.name>rhs</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooSubEnum1\">FooSubEnum1</ref.struct></decl.var.parameter.type></decl.var.parameter>) -> <decl.function.returntype><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.function.returntype></decl.function.operator.infix>",
key.entities: [
@@ -7395,14 +7397,14 @@
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "lhs",
- key.offset: 7975,
+ key.offset: 7962,
key.length: 11
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "rhs",
- key.offset: 7995,
+ key.offset: 7982,
key.length: 11
}
]
@@ -7414,7 +7416,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FooSubEnum1X",
key.usr: "c:@E@FooSubEnum1@FooSubEnum1X",
- key.offset: 8018,
+ key.offset: 8005,
key.length: 37,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FooSubEnum1X</decl.name>: <decl.var.type><ref.struct usr=\"c:@E@FooSubEnum1\">FooSubEnum1</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>",
key.modulename: "Foo.FooSub"
@@ -7423,7 +7425,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FooSubEnum1Y",
key.usr: "c:@E@FooSubEnum1@FooSubEnum1Y",
- key.offset: 8056,
+ key.offset: 8043,
key.length: 37,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FooSubEnum1Y</decl.name>: <decl.var.type><ref.struct usr=\"c:@E@FooSubEnum1\">FooSubEnum1</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>",
key.modulename: "Foo.FooSub"
@@ -7432,7 +7434,7 @@
key.kind: source.lang.swift.decl.var.global,
key.name: "FooSubUnnamedEnumeratorA1",
key.usr: "c:@Ea@FooSubUnnamedEnumeratorA1@FooSubUnnamedEnumeratorA1",
- key.offset: 8094,
+ key.offset: 8081,
key.length: 42,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FooSubUnnamedEnumeratorA1</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>",
key.modulename: "Foo.FooSub"
diff --git a/test/SourceKit/DocSupport/doc_swift_module.swift.response b/test/SourceKit/DocSupport/doc_swift_module.swift.response
index 6abdd9a..cc0ffc4 100644
--- a/test/SourceKit/DocSupport/doc_swift_module.swift.response
+++ b/test/SourceKit/DocSupport/doc_swift_module.swift.response
@@ -1874,6 +1874,7 @@
],
key.offset: 427,
key.length: 187,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:SYsSHRzSH8RawValueSYRpzrlE4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:SYsSHRzSH8RawValueSYRpzrlE4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:SH\">Hashable</ref.protocol></decl.generic_type_requirement>, <decl.generic_type_requirement><ref.generic_type_param usr=\"s:SYsSHRzSH8RawValueSYRpzrlE4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:SY\">RawRepresentable</ref.protocol></decl.generic_type_requirement>, <decl.generic_type_requirement><ref.generic_type_param usr=\"s:SYsSHRzSH8RawValueSYRpzrlE4Selfxmfp\">Self</ref.generic_type_param>.RawValue : <ref.protocol usr=\"s:SH\">Hashable</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.enum,
key.name: "C1Cases",
@@ -2236,6 +2237,7 @@
key.kind: source.lang.swift.decl.extension.protocol,
key.offset: 1258,
key.length: 53,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:4cake2P6P4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:4cake2P6P4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:4cake2P6P\">P6</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.protocol,
key.name: "P6",
@@ -2298,6 +2300,7 @@
key.kind: source.lang.swift.decl.extension.protocol,
key.offset: 1417,
key.length: 79,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:4cake4ProtP4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:4cake4ProtP4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:4cake4ProtP\">Prot</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.protocol,
key.name: "Prot",
@@ -2341,6 +2344,7 @@
],
key.offset: 1498,
key.length: 63,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:4cake4ProtPAASi7ElementRtzrlE4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:4cake4ProtPAASi7ElementRtzrlE4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:4cake4ProtP\">Prot</ref.protocol></decl.generic_type_requirement>, <decl.generic_type_requirement><ref.generic_type_param usr=\"s:4cake4ProtPAASi7ElementRtzrlE4Selfxmfp\">Self</ref.generic_type_param>.Element == <ref.struct usr=\"s:Si\">Int</ref.struct></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.protocol,
key.name: "Prot",
@@ -2431,6 +2435,7 @@
key.kind: source.lang.swift.decl.extension.enum,
key.offset: 1707,
key.length: 76,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:SQ4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:SQ4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:SQ\">Equatable</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.enum,
key.name: "SE",
@@ -2542,6 +2547,7 @@
key.kind: source.lang.swift.decl.extension.struct,
key.offset: 1921,
key.length: 56,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:4cake2P6P4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:4cake2P6P4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:4cake2P6P\">P6</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.struct,
key.name: "S3",
diff --git a/test/SourceKit/DocSupport/doc_swift_module1.swift.response b/test/SourceKit/DocSupport/doc_swift_module1.swift.response
index 0b9a8ea..a4f9d04 100644
--- a/test/SourceKit/DocSupport/doc_swift_module1.swift.response
+++ b/test/SourceKit/DocSupport/doc_swift_module1.swift.response
@@ -742,6 +742,7 @@
key.kind: source.lang.swift.decl.extension.protocol,
key.offset: 160,
key.length: 35,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:5cake19InitProtoP4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:5cake19InitProtoP4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:5cake19InitProtoP\">InitProto</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.protocol,
key.name: "InitProto",
@@ -920,6 +921,7 @@
key.kind: source.lang.swift.decl.extension.protocol,
key.offset: 493,
key.length: 118,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:5cake12P2P4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:5cake12P2P4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:5cake12P2P\">P2</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.protocol,
key.name: "P2",
@@ -998,6 +1000,7 @@
],
key.offset: 613,
key.length: 58,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:5cake12P2PA2A2P3RzrlE4Selfxmfp\"><decl.generic_type_param.name>Self</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:5cake12P2PA2A2P3RzrlE4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:5cake12P2P\">P2</ref.protocol></decl.generic_type_requirement>, <decl.generic_type_requirement><ref.generic_type_param usr=\"s:5cake12P2PA2A2P3RzrlE4Selfxmfp\">Self</ref.generic_type_param> : <ref.protocol usr=\"s:5cake12P3P\">P3</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.protocol,
key.name: "P2",
@@ -1050,6 +1053,7 @@
],
key.offset: 713,
key.length: 45,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:SD3Keyxmfp\"><decl.generic_type_param.name>Key</decl.generic_type_param.name></decl.generic_type_param>, <decl.generic_type_param usr=\"s:SD5Valueq_mfp\"><decl.generic_type_param.name>Value</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement>Key : <ref.protocol usr=\"s:SH\">Hashable</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.struct,
key.name: "Keys",
@@ -1078,6 +1082,7 @@
],
key.offset: 760,
key.length: 60,
+ key.fully_annotated_generic_signature: "<<decl.generic_type_param usr=\"s:SD4KeysV5cake1AC2P1RzrlE3Keyxmfp\"><decl.generic_type_param.name>Key</decl.generic_type_param.name></decl.generic_type_param>, <decl.generic_type_param usr=\"s:SD4KeysV5cake1AC2P1RzrlE5Valueq_mfp\"><decl.generic_type_param.name>Value</decl.generic_type_param.name></decl.generic_type_param> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement>Key : <ref.protocol usr=\"s:SH\">Hashable</ref.protocol></decl.generic_type_requirement>, <decl.generic_type_requirement>Key : <ref.protocol usr=\"s:5cake12P1P\">P1</ref.protocol></decl.generic_type_requirement>>",
key.extends: {
key.kind: source.lang.swift.ref.struct,
key.name: "Keys",
diff --git a/test/SourceKit/SyntaxTree/pound_if.swift b/test/SourceKit/SyntaxTree/pound_if.swift
new file mode 100644
index 0000000..27635d3
--- /dev/null
+++ b/test/SourceKit/SyntaxTree/pound_if.swift
@@ -0,0 +1,7 @@
+// RUN: %target-swift-frontend -emit-syntax %s > %t.emit
+// RUN: %sourcekitd-test -req=syntax-tree %s > %t.sourcekit
+// RUN: diff %t.emit %t.sourcekit
+
+#if swift(<4)
+ print(1)
+#endif
diff --git a/test/api-digester/Outputs/stability-stdlib-abi.swift.expected b/test/api-digester/Outputs/stability-stdlib-abi.swift.expected
index 152c968..2ad47b5 100644
--- a/test/api-digester/Outputs/stability-stdlib-abi.swift.expected
+++ b/test/api-digester/Outputs/stability-stdlib-abi.swift.expected
@@ -16,6 +16,7 @@
Func _uint64ToStringImpl(_:_:_:_:_:) has been removed
Func _typeByMangledName(_:substitutions:) has been removed
Func _withUninitializedString(_:) has been removed
+Func abs(_:) has been removed
Func Optional.unwrappedOrError() has been removed
Struct _UnwrappingFailed has been removed
@@ -481,6 +482,16 @@
Protocol _NSFastEnumeration has been removed
Protocol _ShadowProtocol has been removed
+EnumElement _StringComparisonResult.equal in a non-resilient type changes position from 1 to 0
+EnumElement _StringComparisonResult.greater has been removed
+EnumElement _StringComparisonResult.less in a non-resilient type changes position from 0 to 1
+Func _StringGuts.withFastUTF8(range:_:) has parameter 0 type change from Optional<Range<Int>> to Range<Int>
+Func _binaryCompare(_:_:) has been removed
+Func _stringCompare(_:_:expecting:) has been renamed to Func _stringCompareInternal(_:_:expecting:)
+Func _stringCompare(_:_:expecting:) has parameter 0 type change from UnsafeBufferPointer<UInt8> to _StringGuts
+Func _stringCompare(_:_:expecting:) has parameter 1 type change from UnsafeBufferPointer<UInt8> to _StringGuts
+Func _stringCompareSlow(_:_:_:_:expecting:) has been removed
+
Constructor _StringGutsSlice.init(_:) has been removed
Constructor _StringGutsSlice.init(_:_:) has been removed
Func _StringGutsSlice._normalizedHash(into:) has been removed
diff --git a/test/api-digester/Outputs/stability-stdlib-source.swift.expected b/test/api-digester/Outputs/stability-stdlib-source.swift.expected
index c729fcb..5a618cf 100644
--- a/test/api-digester/Outputs/stability-stdlib-source.swift.expected
+++ b/test/api-digester/Outputs/stability-stdlib-source.swift.expected
@@ -97,6 +97,7 @@
Func UnsafeMutableRawPointer.deallocate(bytes:alignedTo:) has been removed (deprecated)
Func UnsafeMutableRawPointer.initializeMemory(as:at:count:to:) has been removed (deprecated)
Func UnsafeMutableRawPointer.initializeMemory(as:from:) has been removed (deprecated)
+Func abs(_:) has been removed
Protocol Collection has generic signature change from <Self : Sequence, Self.Index : Comparable, Self.Index == Self.Indices.Element, Self.Indices : Collection, Self.Indices == Self.Indices.SubSequence, Self.SubSequence : Collection, Self.Indices.Element == Self.Indices.Index, Self.Indices.Index == Self.SubSequence.Index, Self.SubSequence.Index == Self.Indices.Indices.Element, Self.Indices.Indices.Element == Self.Indices.Indices.Index, Self.Indices.Indices.Index == Self.SubSequence.Indices.Element, Self.SubSequence.Indices.Element == Self.SubSequence.Indices.Index, Self.SubSequence.Indices.Index == Self.SubSequence.Indices.Indices.Element, Self.SubSequence.Indices.Indices.Element == Self.SubSequence.Indices.Indices.Index> to <Self : Sequence, Self.Element == Self.SubSequence.Element, Self.Index : Comparable, Self.Index == Self.Indices.Element, Self.Indices : Collection, Self.Indices == Self.Indices.SubSequence, Self.SubSequence : Collection, Self.SubSequence == Self.SubSequence.SubSequence, Self.Indices.Element == Self.Indices.Index, Self.Indices.Index == Self.SubSequence.Index, Self.SubSequence.Index == Self.Indices.Indices.Element, Self.Indices.Indices.Element == Self.Indices.Indices.Index, Self.Indices.Indices.Index == Self.SubSequence.Indices.Element, Self.SubSequence.Indices.Element == Self.SubSequence.Indices.Index, Self.SubSequence.Indices.Index == Self.SubSequence.Indices.Indices.Element, Self.SubSequence.Indices.Indices.Element == Self.SubSequence.Indices.Indices.Index>
Protocol Sequence has generic signature change from <Self.Element == Self.Iterator.Element, Self.Iterator : IteratorProtocol, Self.SubSequence : Sequence, Self.SubSequence == Self.SubSequence.SubSequence, Self.Iterator.Element == Self.SubSequence.Element, Self.SubSequence.Element == Self.SubSequence.Iterator.Element> to <Self.Element == Self.Iterator.Element, Self.Iterator : IteratorProtocol>
Protocol _SequenceWrapper has been removed
diff --git a/test/attr/accessibility_print_inferred_type_witnesses.swift b/test/attr/accessibility_print_inferred_type_witnesses.swift
new file mode 100644
index 0000000..5e4dce3
--- /dev/null
+++ b/test/attr/accessibility_print_inferred_type_witnesses.swift
@@ -0,0 +1,41 @@
+// RUN: %empty-directory(%t)
+
+// RUN: %target-swift-ide-test -skip-deinit=false -print-ast-typechecked -print-access -source-filename=%s -swift-version 4| %FileCheck -check-prefix=CHECK -check-prefix=CHECK-4 %s
+// RUN: %target-swift-frontend -emit-module-path %t/accessibility_print.swiftmodule -module-name accessibility_print %s -swift-version 4
+// RUN: %target-swift-ide-test -skip-deinit=false -print-module -print-access -module-to-print=accessibility_print -I %t -source-filename=%s -swift-version 4 | %FileCheck -check-prefix=CHECK -check-prefix=CHECK-4 %s
+
+// RUN: %target-swift-ide-test -skip-deinit=false -print-ast-typechecked -print-access -source-filename=%s -swift-version 5 | %FileCheck -check-prefix=CHECK -check-prefix=CHECK-5 %s
+// RUN: %target-swift-frontend -emit-module-path %t/accessibility_print.swiftmodule -module-name accessibility_print %s -swift-version 5
+// RUN: %target-swift-ide-test -skip-deinit=false -print-module -print-access -module-to-print=accessibility_print -I %t -source-filename=%s -swift-version 5 | %FileCheck -check-prefix=CHECK -check-prefix=CHECK-5 %s
+
+// Enabling resilience means opting into the new behavior.
+// RUN: %target-swift-frontend -emit-module-path %t/accessibility_print.swiftmodule -module-name accessibility_print %s -swift-version 4 -enable-resilience
+// RUN: %target-swift-ide-test -skip-deinit=false -print-module -print-access -module-to-print=accessibility_print -I %t -source-filename=%s -swift-version 4 | %FileCheck -check-prefix=CHECK -check-prefix=CHECK-5 %s
+
+internal struct InternalStruct {}
+
+public protocol PublicAssocTypeProto {
+ associatedtype PublicValue
+ var publicValue: PublicValue { get }
+}
+fileprivate protocol FilePrivateAssocTypeProto {
+ associatedtype FilePrivateValue
+ var filePrivateValue: FilePrivateValue { get }
+}
+
+// CHECK-LABEL: private{{(\*/)?}} class PrivateImpl : PublicAssocTypeProto, FilePrivateAssocTypeProto {
+private class PrivateImpl: PublicAssocTypeProto, FilePrivateAssocTypeProto {
+ fileprivate var publicValue: InternalStruct?
+ fileprivate var filePrivateValue: Int?
+ // CHECK-DAG: {{^}} fileprivate typealias PublicValue
+ // CHECK-DAG: {{^}} fileprivate typealias FilePrivateValue
+} // CHECK: {{^[}]}}
+
+// CHECK-LABEL: public{{(\*/)?}} class PublicImpl : PublicAssocTypeProto, FilePrivateAssocTypeProto {
+public class PublicImpl: PublicAssocTypeProto, FilePrivateAssocTypeProto {
+ public var publicValue: Int?
+ fileprivate var filePrivateValue: InternalStruct?
+ // CHECK-DAG: {{^}} public typealias PublicValue
+ // CHECK-4-DAG: {{^}} internal typealias FilePrivateValue
+ // CHECK-5-DAG: {{^}} fileprivate typealias FilePrivateValue
+} // CHECK: {{^[}]}}
diff --git a/test/decl/ext/generic.swift b/test/decl/ext/generic.swift
index ba3aead..d7994a0 100644
--- a/test/decl/ext/generic.swift
+++ b/test/decl/ext/generic.swift
@@ -192,3 +192,13 @@
extension A.B.C where T == V, X == Z.Assoc2 {
func f() { }
}
+
+// Extensions of nested non-generics within generics.
+extension A.B {
+ struct D { }
+}
+
+extension A.B.D {
+ func g() { }
+}
+
diff --git a/test/decl/protocol/conforms/error_self_conformance.swift b/test/decl/protocol/conforms/error_self_conformance.swift
new file mode 100644
index 0000000..7293d02
--- /dev/null
+++ b/test/decl/protocol/conforms/error_self_conformance.swift
@@ -0,0 +1,22 @@
+// RUN: %target-typecheck-verify-swift
+
+func wantsError<T: Error>(_: T) {}
+
+func testSimple(error: Error) {
+ wantsError(error)
+}
+
+protocol ErrorRefinement : Error {}
+func testErrorRefinment(error: ErrorRefinement) {
+ wantsError(error) // expected-error {{protocol type 'ErrorRefinement' cannot conform to 'Error' because only concrete types can conform to protocols}}
+}
+
+protocol OtherProtocol {}
+func testErrorComposition(error: Error & OtherProtocol) {
+ wantsError(error) // expected-error {{protocol type 'Error & OtherProtocol' cannot conform to 'Error' because only concrete types can conform to protocols}}
+}
+
+class C {}
+func testErrorCompositionWithClass(error: Error & C) {
+ wantsError(error) // expected-error {{protocol type 'C & Error' cannot conform to 'Error' because only concrete types can conform to protocols}}
+}
diff --git a/test/lit.cfg b/test/lit.cfg
index 0fa7b66..3718069 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -569,8 +569,6 @@
if 'swift_interpreter' in config.available_features:
config.available_features.add('swift-remoteast-test')
-config.target_swiftmodule_name = "unknown.swiftmodule"
-config.target_swiftdoc_name = "unknown.swiftdoc"
config.target_runtime = "unknown"
swift_reflection_test_name = 'swift-reflection-test' + config.variant_suffix
@@ -609,8 +607,6 @@
if run_vendor == 'apple':
config.available_features.add('objc_interop')
- config.target_swiftmodule_name = run_cpu + ".swiftmodule"
- config.target_swiftdoc_name = run_cpu + ".swiftdoc"
config.target_object_format = "macho"
config.target_dylib_extension = "dylib"
config.target_codesign = "codesign -f -s -"
@@ -646,15 +642,6 @@
lit_config.note('Testing watchOS ' + config.variant_triple)
xcrun_sdk_name = "watchos"
- if run_cpu == "armv7" or run_cpu == "armv7s" or run_cpu == "armv7k":
- config.target_swiftmodule_name = "arm.swiftmodule"
- config.target_swiftdoc_name = "arm.swiftdoc"
- elif run_cpu == "arm64":
- config.target_swiftmodule_name = "arm64.swiftmodule"
- config.target_swiftdoc_name = "arm64.swiftdoc"
- else:
- lit_config.fatal("Unknown CPU '%s'" % run_cpu)
-
config.target_cc_options = (
"-arch %s -m%s-version-min=%s %s" %
(run_cpu, run_os, run_vers, clang_mcp_opt))
@@ -809,8 +796,6 @@
config.target_object_format = "elf"
config.target_dylib_extension = "so"
config.target_sdk_name = "linux"
- config.target_swiftmodule_name = run_cpu + ".swiftmodule"
- config.target_swiftdoc_name = run_cpu + ".swiftdoc"
config.target_runtime = "native"
config.target_swift_autolink_extract = inferSwiftBinary("swift-autolink-extract")
config.target_build_swift = (
@@ -1270,8 +1255,8 @@
config.substitutions.insert(0, ('%platform-module-dir', platform_module_dir))
config.substitutions.insert(0, ('%platform-sdk-overlay-dir', platform_sdk_overlay_dir))
-config.substitutions.append(('%target-swiftmodule-name', config.target_swiftmodule_name))
-config.substitutions.append(('%target-swiftdoc-name', config.target_swiftdoc_name))
+config.substitutions.append(('%target-swiftmodule-name', run_cpu + '.swiftmodule'))
+config.substitutions.append(('%target-swiftdoc-name', run_cpu + '.swiftdoc'))
config.substitutions.append(('%target-object-format', config.target_object_format))
config.substitutions.append(('%target-dylib-extension', config.target_dylib_extension))
diff --git a/test/stdlib/AnyHashableCasts.swift.gyb b/test/stdlib/AnyHashableCasts.swift.gyb
index 2923f8b..ad5cd2f 100644
--- a/test/stdlib/AnyHashableCasts.swift.gyb
+++ b/test/stdlib/AnyHashableCasts.swift.gyb
@@ -118,6 +118,16 @@
}
% end
+AnyHashableCasts.test("Casting to AnyHashable doesn't leak") {
+ do {
+ let tracked = LifetimeTracked(42)
+ let anyHashable = AnyHashable(tracked)
+ let anyObject = anyHashable as AnyObject
+ _ = anyObject as? AnyHashable
+ }
+ expectEqual(LifetimeTracked.instances, 0)
+}
+
#if _runtime(_ObjC)
// A wrapper type around Int that bridges to NSNumber.
struct IntWrapper1: _SwiftNewtypeWrapper, Hashable, _ObjectiveCBridgeable {
diff --git a/test/stdlib/FloatingPoint.swift.gyb b/test/stdlib/FloatingPoint.swift.gyb
index 729f742..79e9715 100644
--- a/test/stdlib/FloatingPoint.swift.gyb
+++ b/test/stdlib/FloatingPoint.swift.gyb
@@ -413,6 +413,11 @@
public var isQuietNaN: Bool { return isNaN && !isSignalingNaN }
}
+func genericAbs<T: SignedNumeric & Comparable>(_ x: T) -> T {
+ return abs(x)
+}
+
+
%for Self in ['Float', 'Double', 'Float80']:
% if Self == 'Float80':
#if !os(Windows) && (arch(i386) || arch(x86_64))
@@ -533,6 +538,12 @@
expectEqual(0, ${Self}(2).significandWidth)
expectEqual(1, ${Self}(3).significandWidth)
}
+
+FloatingPoint.test("${Self}.absNegativeZero") {
+ expectEqual(abs(${Self}(-0.0)), ${Self}(0.0))
+ expectEqual(genericAbs(${Self}(-0.0)), ${Self}(0.0))
+}
+
% if Self == 'Float80':
#endif
% end
diff --git a/test/stdlib/IntegerCompatibility.swift b/test/stdlib/IntegerCompatibility.swift
index db935bc..aeb63bb 100644
--- a/test/stdlib/IntegerCompatibility.swift
+++ b/test/stdlib/IntegerCompatibility.swift
@@ -55,3 +55,9 @@
func sr6634(x: UnsafeBufferPointer<UInt8>) -> Int {
return x.lazy.filter { $0 > 127 || $0 == 0 }.count // should be unambiguous
}
+
+// abs of an integer literal
+func returnIntAbs() -> Int {
+ let x = abs(-8)
+ return x
+}
diff --git a/tools/SourceKit/include/SourceKit/Core/LangSupport.h b/tools/SourceKit/include/SourceKit/Core/LangSupport.h
index 811323c..eb659d1 100644
--- a/tools/SourceKit/include/SourceKit/Core/LangSupport.h
+++ b/tools/SourceKit/include/SourceKit/Core/LangSupport.h
@@ -398,6 +398,7 @@
llvm::SmallString<64> ProvideImplementationOfUSR;
llvm::SmallString<64> DocComment;
llvm::SmallString<64> FullyAnnotatedDecl;
+ llvm::SmallString<64> FullyAnnotatedGenericSig;
llvm::SmallString<64> LocalizationKey;
std::vector<DocGenericParam> GenericParams;
std::vector<std::string> GenericRequirements;
diff --git a/tools/SourceKit/lib/SwiftLang/SwiftDocSupport.cpp b/tools/SourceKit/lib/SwiftLang/SwiftDocSupport.cpp
index bee4396..f401953 100644
--- a/tools/SourceKit/lib/SwiftLang/SwiftDocSupport.cpp
+++ b/tools/SourceKit/lib/SwiftLang/SwiftDocSupport.cpp
@@ -397,6 +397,14 @@
VD, SynthesizedTarget, OS);
else
SwiftLangSupport::printFullyAnnotatedDeclaration(VD, Type(), OS);
+ } else if (auto *E = dyn_cast<ExtensionDecl>(D)) {
+ if (auto *Sig = E->getGenericSignature()) {
+ // The extension under printing is potentially part of a synthesized
+ // extension. Thus it's hard to print the fully annotated decl. We
+ // need to at least print the generic signature here.
+ llvm::raw_svector_ostream OS(Info.FullyAnnotatedGenericSig);
+ SwiftLangSupport::printFullyAnnotatedGenericReq(Sig, OS);
+ }
}
}
diff --git a/tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp b/tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp
index 8bb4fab..2d84e86 100644
--- a/tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp
+++ b/tools/SourceKit/lib/SwiftLang/SwiftEditor.cpp
@@ -689,6 +689,9 @@
Parser->getDiagnosticEngine().addConsumer(DiagConsumer);
+ // Collecting syntactic information shouldn't evaluate # conditions.
+ Parser->getParser().State->PerformConditionEvaluation = false;
+
// If there is a syntax parsing cache, incremental syntax parsing is
// performed and thus the generated AST may not be up-to-date.
HasUpToDateAST = CompInv.getMainFileSyntaxParsingCache() == nullptr;
diff --git a/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.h b/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.h
index 4e148ed..bac2d2c 100644
--- a/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.h
+++ b/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.h
@@ -41,6 +41,7 @@
class SourceFile;
class SILOptions;
class ValueDecl;
+ class GenericSignature;
enum class AccessorKind;
namespace syntax {
@@ -377,6 +378,9 @@
swift::TypeOrExtensionDecl Target,
llvm::raw_ostream &OS);
+ static void
+ printFullyAnnotatedGenericReq(const swift::GenericSignature *Sig,
+ llvm::raw_ostream &OS);
/// Tries to resolve the path to the real file-system path. If it fails it
/// returns the original path;
static std::string resolvePathSymlinks(StringRef FilePath);
diff --git a/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp b/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
index 62bdd2e..8d7881c 100644
--- a/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
+++ b/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
@@ -20,6 +20,7 @@
#include "swift/AST/Decl.h"
#include "swift/AST/NameLookup.h"
#include "swift/AST/SwiftNameTranslation.h"
+#include "swift/AST/GenericSignature.h"
#include "swift/Basic/SourceManager.h"
#include "swift/Frontend/Frontend.h"
#include "swift/Frontend/PrintingDiagnosticConsumer.h"
@@ -431,6 +432,14 @@
VD->print(Printer, PO);
}
+void SwiftLangSupport::printFullyAnnotatedGenericReq(
+ const swift::GenericSignature *Sig, llvm::raw_ostream &OS) {
+ assert(Sig);
+ FullyAnnotatedDeclarationPrinter Printer(OS);
+ PrintOptions PO = PrintOptions::printQuickHelpDeclaration();
+ Sig->print(Printer, PO);
+}
+
void SwiftLangSupport::printFullyAnnotatedSynthesizedDeclaration(
const swift::ValueDecl *VD, TypeOrExtensionDecl Target,
llvm::raw_ostream &OS) {
diff --git a/tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp b/tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp
index ef4332e..40baa90 100644
--- a/tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp
+++ b/tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp
@@ -1410,6 +1410,8 @@
Elem.set(KeyDocFullAsXML, Info.DocComment);
if (!Info.FullyAnnotatedDecl.empty())
Elem.set(KeyFullyAnnotatedDecl, Info.FullyAnnotatedDecl);
+ if (!Info.FullyAnnotatedGenericSig.empty())
+ Elem.set(KeyFullyAnnotatedGenericSignature, Info.FullyAnnotatedGenericSig);
if (!Info.LocalizationKey.empty())
Elem.set(KeyLocalizationKey, Info.LocalizationKey);
diff --git a/unittests/runtime/CompatibilityOverride.cpp b/unittests/runtime/CompatibilityOverride.cpp
index acb7838..953e655 100644
--- a/unittests/runtime/CompatibilityOverride.cpp
+++ b/unittests/runtime/CompatibilityOverride.cpp
@@ -168,6 +168,11 @@
ASSERT_EQ(Result, nullptr);
}
+TEST_F(CompatibilityOverrideTest, test_swift_conformsToSwiftProtocol) {
+ auto Result = swift_conformsToSwiftProtocol(nullptr, nullptr, StringRef());
+ ASSERT_EQ(Result, nullptr);
+}
+
TEST_F(CompatibilityOverrideTest, test_swift_getTypeByMangledNode) {
Demangler demangler;
auto Result = swift_getTypeByMangledNode(demangler, nullptr, nullptr,
diff --git a/utils/gyb_sourcekit_support/UIDs.py b/utils/gyb_sourcekit_support/UIDs.py
index c3b8c0c..d75796c 100644
--- a/utils/gyb_sourcekit_support/UIDs.py
+++ b/utils/gyb_sourcekit_support/UIDs.py
@@ -59,6 +59,8 @@
KEY('SelectorName', 'key.selector_name'),
KEY('AnnotatedDecl', 'key.annotated_decl'),
KEY('FullyAnnotatedDecl', 'key.fully_annotated_decl'),
+ KEY('FullyAnnotatedGenericSignature',
+ 'key.fully_annotated_generic_signature'),
KEY('DocBrief', 'key.doc.brief'),
KEY('Context', 'key.context'),
KEY('ModuleImportDepth', 'key.moduleimportdepth'),
diff --git a/validation-test/IDE/slow_fixed/rdar45511835.swift b/validation-test/IDE/slow_fixed/rdar45511835.swift
new file mode 100644
index 0000000..4f9dd01
--- /dev/null
+++ b/validation-test/IDE/slow_fixed/rdar45511835.swift
@@ -0,0 +1,10 @@
+// RUN: %target-swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename=%s | %FileCheck %s
+
+// This used to take ~6 min to complete.
+
+func testing() {
+ return (["a"] + [1].map { String($0) })
+ .map { $0 + "b" as String }
+ .filter { $0 != "" } #^COMPLETE^#
+}
+// CHECK: Decl[InfixOperatorFunction]/{{.*}}: [' ']+ {#[String]#}[#[String]#]; name=+ [String]
diff --git a/validation-test/ParseableInterface/verify_all_overlays.swift b/validation-test/ParseableInterface/verify_all_overlays.swift
index de728a0..a88d530 100644
--- a/validation-test/ParseableInterface/verify_all_overlays.swift
+++ b/validation-test/ParseableInterface/verify_all_overlays.swift
@@ -1,6 +1,9 @@
+// Note that this test should still "pass" when no swiftinterfaces have been
+// generated.
+
// RUN: %empty-directory(%t)
-// RUN: for x in %platform-sdk-overlay-dir/*.swiftinterface; do [[ $(basename "$x") = Swift.swiftinterface || $(basename "$x") = simd.swiftinterface || $(basename "$x") = SwiftLang.swiftinterface ]] && continue; %target-swift-frontend "$x" -emit-module -o %t/$(basename "$x" .swiftinterface).swiftmodule -disable-objc-attr-requires-foundation-module -enable-resilience -Fsystem %sdk/System/Library/PrivateFrameworks/ -swift-version 4 || echo '%target-os:' $(basename "$x") >> %t/failures.txt; done
-// RUN: diff <(grep '%target-os:' %s) <(sort -f %t/failures.txt)
+// RUN: for x in %platform-sdk-overlay-dir/*.swiftinterface; do [[ $(basename "$x") = Swift.swiftinterface || $(basename "$x") = simd.swiftinterface || $(basename "$x") = SwiftLang.swiftinterface || $(basename "$x") = '*.swiftinterface' ]] && continue; %target-swift-frontend "$x" -emit-module -o %t/$(basename "$x" .swiftinterface).swiftmodule -disable-objc-attr-requires-foundation-module -enable-resilience -Fsystem %sdk/System/Library/PrivateFrameworks/ -swift-version 4 || echo '%target-os:' $(basename "$x") >> %t/failures.txt; done
+// RUN: test ! -e %t/failures.txt || diff <(grep '%target-os:' %s) <(sort -f %t/failures.txt)
// REQUIRES: nonexecutable_test
diff --git a/validation-test/ParseableInterface/verify_all_overlays_O.swift b/validation-test/ParseableInterface/verify_all_overlays_O.swift
index 4a3d632..6690e5d 100644
--- a/validation-test/ParseableInterface/verify_all_overlays_O.swift
+++ b/validation-test/ParseableInterface/verify_all_overlays_O.swift
@@ -1,6 +1,9 @@
+// Note that this test should still "pass" when no swiftinterfaces have been
+// generated.
+
// RUN: %empty-directory(%t)
-// RUN: for x in %platform-sdk-overlay-dir/*.swiftinterface; do [[ $(basename "$x") = Swift.swiftinterface || $(basename "$x") = simd.swiftinterface || $(basename "$x") = SwiftLang.swiftinterface ]] && continue; %target-swift-frontend "$x" -emit-module -o %t/$(basename "$x" .swiftinterface).swiftmodule -disable-objc-attr-requires-foundation-module -enable-resilience -Fsystem %sdk/System/Library/PrivateFrameworks/ -swift-version 4 -O || echo '%target-os:' $(basename "$x") >> %t/failures.txt; done
-// RUN: diff <(grep '%target-os:' %s) <(sort -f %t/failures.txt)
+// RUN: for x in %platform-sdk-overlay-dir/*.swiftinterface; do [[ $(basename "$x") = Swift.swiftinterface || $(basename "$x") = simd.swiftinterface || $(basename "$x") = SwiftLang.swiftinterface || $(basename "$x") = '*.swiftinterface' ]] && continue; %target-swift-frontend "$x" -emit-module -o %t/$(basename "$x" .swiftinterface).swiftmodule -disable-objc-attr-requires-foundation-module -enable-resilience -Fsystem %sdk/System/Library/PrivateFrameworks/ -swift-version 4 -O || echo '%target-os:' $(basename "$x") >> %t/failures.txt; done
+// RUN: test ! -e %t/failures.txt || diff <(grep '%target-os:' %s) <(sort -f %t/failures.txt)
// REQUIRES: nonexecutable_test
diff --git a/validation-test/ParseableInterface/verify_simd.swift b/validation-test/ParseableInterface/verify_simd.swift
index 2dca5a6..5948dfc 100644
--- a/validation-test/ParseableInterface/verify_simd.swift
+++ b/validation-test/ParseableInterface/verify_simd.swift
@@ -1,6 +1,9 @@
+// Note that this test should still "pass" when simd.swiftinterface has not been
+// generated.
+
// RUN: %empty-directory(%t)
-// RUN: %target-swift-frontend %platform-sdk-overlay-dir/simd.swiftinterface -emit-module -o %t/simd.swiftmodule -enable-resilience -parse-stdlib -import-module Swift -swift-version 4
-// RUN: %target-swift-frontend %platform-sdk-overlay-dir/simd.swiftinterface -emit-module -o %t/simd.swiftmodule -enable-resilience -parse-stdlib -import-module Swift -swift-version 4 -O
+// RUN: test ! -e %platform-sdk-overlay-dir/simd.swiftinterface || %target-swift-frontend %platform-sdk-overlay-dir/simd.swiftinterface -emit-module -o %t/simd.swiftmodule -enable-resilience -parse-stdlib -import-module Swift -swift-version 4
+// RUN: test ! -e %platform-sdk-overlay-dir/simd.swiftinterface || %target-swift-frontend %platform-sdk-overlay-dir/simd.swiftinterface -emit-module -o %t/simd.swiftmodule -enable-resilience -parse-stdlib -import-module Swift -swift-version 4 -O
// REQUIRES: nonexecutable_test
// REQUIRES: objc_interop
diff --git a/validation-test/stdlib/Lazy.swift.gyb b/validation-test/stdlib/Lazy.swift.gyb
index 6b42daf..49d648e 100644
--- a/validation-test/stdlib/Lazy.swift.gyb
+++ b/validation-test/stdlib/Lazy.swift.gyb
@@ -1251,36 +1251,32 @@
% for Traversal in 'Forward', 'Bidirectional':
% TraversalCollection = collectionForTraversal(Traversal)
- // re-enable commented out test case below as well when this is fixed
- // (find FIXME: rdar45956357)
- if #available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) {
- tests.test("FlattenCollection/${Traversal}/\(data)") {
- let base = Minimal${TraversalCollection}(
- elements: data.map { Minimal${TraversalCollection}(elements: $0) })
+ tests.test("FlattenCollection/${Traversal}/\(data)") {
+ let base = Minimal${TraversalCollection}(
+ elements: data.map { Minimal${TraversalCollection}(elements: $0) })
- let flattened = base.joined()
- check${Traversal}Collection(expected, flattened, resiliencyChecks: .none)
+ let flattened = base.joined()
+ check${Traversal}Collection(expected, flattened, resiliencyChecks: .none)
- // Checking that flatten doesn't introduce laziness
- var calls = 0
- _ = flattened.map { _ in calls += 1 }
- expectLE(
- expected.count, calls,
- "unexpected laziness in \(type(of: flattened))")
- }
+ // Checking that flatten doesn't introduce laziness
+ var calls = 0
+ _ = flattened.map { _ in calls += 1 }
+ expectLE(
+ expected.count, calls,
+ "unexpected laziness in \(type(of: flattened))")
+ }
- tests.test("FlattenCollection/${Traversal}/Lazy\(data)") {
- // Checking that flatten doesn't remove laziness
- let base = Minimal${TraversalCollection}(
- elements: data.map { Minimal${TraversalCollection}(elements: $0) }
- ).lazy.map { $0 }
+ tests.test("FlattenCollection/${Traversal}/Lazy\(data)") {
+ // Checking that flatten doesn't remove laziness
+ let base = Minimal${TraversalCollection}(
+ elements: data.map { Minimal${TraversalCollection}(elements: $0) }
+ ).lazy.map { $0 }
- let flattened = base.joined()
+ let flattened = base.joined()
- var calls = 0
- _ = flattened.map { _ in calls += 1 }
- expectEqual(0, calls, "unexpected eagerness in \(type(of: flattened))")
- }
+ var calls = 0
+ _ = flattened.map { _ in calls += 1 }
+ expectEqual(0, calls, "unexpected eagerness in \(type(of: flattened))")
}
% end
}
@@ -1295,38 +1291,20 @@
let prefixDropWhileTests: [(data: [Int], value: Int, pivot: Int)]
-// FIXME: rdar45956357
-if #available(macOS 10.14, iOS 12.0, watchOS 5.0, tvOS 12.0, *) {
- prefixDropWhileTests = [
- ([], 0, 0),
- ([0], 0, 0),
- ([0], 99, 1),
- ([0, 10], 0, 0),
- ([0, 10], 10, 1),
- ([0, 10], 99, 2),
- ([0, 10, 20, 30, 40], 0, 0),
- ([0, 10, 20, 30, 40], 10, 1),
- ([0, 10, 20, 30, 40], 20, 2),
- ([0, 10, 20, 30, 40], 30, 3),
- ([0, 10, 20, 30, 40], 40, 4),
- ([0, 10, 20, 30, 40], 99, 5)
- ]
-} else {
- prefixDropWhileTests = [
- ([], 0, 0),
- ([0], 0, 0),
- // ([0], 99, 1),
- ([0, 10], 0, 0),
- // ([0, 10], 10, 1),
- // ([0, 10], 99, 2),
- // ([0, 10, 20, 30, 40], 0, 0),
- // ([0, 10, 20, 30, 40], 10, 1),
- // ([0, 10, 20, 30, 40], 20, 2),
- // ([0, 10, 20, 30, 40], 30, 3),
- // ([0, 10, 20, 30, 40], 40, 4),
- // ([0, 10, 20, 30, 40], 99, 5)
- ]
-}
+prefixDropWhileTests = [
+ ([], 0, 0),
+ ([0], 0, 0),
+ ([0], 99, 1),
+ ([0, 10], 0, 0),
+ ([0, 10], 10, 1),
+ ([0, 10], 99, 2),
+ ([0, 10, 20, 30, 40], 0, 0),
+ ([0, 10, 20, 30, 40], 10, 1),
+ ([0, 10, 20, 30, 40], 20, 2),
+ ([0, 10, 20, 30, 40], 30, 3),
+ ([0, 10, 20, 30, 40], 40, 4),
+ ([0, 10, 20, 30, 40], 99, 5)
+]
% for Kind in 'Sequence', 'Forward', 'Bidirectional':
% Self = 'Sequence' if Kind == 'Sequence' else collectionForTraversal(Kind)
diff --git a/validation-test/stdlib/SetAnyHashableExtensions.swift b/validation-test/stdlib/SetAnyHashableExtensions.swift
index 66c371d..54ef1f7 100644
--- a/validation-test/stdlib/SetAnyHashableExtensions.swift
+++ b/validation-test/stdlib/SetAnyHashableExtensions.swift
@@ -126,7 +126,10 @@
expectEqual(expected, s)
}
-SetTests.test("insert<Hashable>(_:)/FormerCastTrap") {
+SetTests.test("insert<Hashable>(_:)/CastTrap")
+ .crashOutputMatches("Could not cast value of type 'main.TestHashableDerivedA'")
+ .crashOutputMatches("to 'main.TestHashableDerivedB'")
+ .code {
var s: Set<AnyHashable> = [
AnyHashable(TestHashableDerivedA(1010, identity: 1)),
]
@@ -138,6 +141,7 @@
expectEqual(1, memberAfterInsert.identity)
}
+ expectCrashLater()
_ = s.insert(TestHashableDerivedB(1010, identity: 3))
}
@@ -177,7 +181,10 @@
expectEqual(expected, s)
}
-SetTests.test("update<Hashable>(with:)/FormerCastTrap") {
+SetTests.test("update<Hashable>(with:)/CastTrap")
+ .crashOutputMatches("Could not cast value of type 'main.TestHashableDerivedA'")
+ .crashOutputMatches("to 'main.TestHashableDerivedB'")
+ .code {
var s: Set<AnyHashable> = [
AnyHashable(TestHashableDerivedA(1010, identity: 1)),
]
@@ -187,6 +194,7 @@
expectEqual(1, old.identity)
}
+ expectCrashLater()
s.update(with: TestHashableDerivedB(1010, identity: 3))
}
@@ -220,7 +228,10 @@
}
}
-SetTests.test("remove<Hashable>(_:)/FormerCastTrap") {
+SetTests.test("remove<Hashable>(_:)/CastTrap")
+ .crashOutputMatches("Could not cast value of type 'main.TestHashableDerivedA'")
+ .crashOutputMatches("to 'main.TestHashableDerivedB'")
+ .code {
var s: Set<AnyHashable> = [
AnyHashable(TestHashableDerivedA(1010, identity: 1)),
AnyHashable(TestHashableDerivedA(2020, identity: 1)),
@@ -232,6 +243,7 @@
expectEqual(1, old.identity)
}
+ expectCrashLater()
s.remove(TestHashableDerivedB(2020, identity: 2))
}
diff --git a/validation-test/stdlib/String.swift b/validation-test/stdlib/String.swift
index c1f597f..a31c356 100644
--- a/validation-test/stdlib/String.swift
+++ b/validation-test/stdlib/String.swift
@@ -2043,10 +2043,24 @@
switch comparison {
case .less:
expectLT(pair.0, pair.1)
+ if !pair.0.isEmpty {
+ // Test mixed String/Substring
+ expectTrue(pair.0.dropLast() < pair.1)
+ }
case .greater:
expectGT(pair.0, pair.1)
+ if !pair.1.isEmpty {
+ // Test mixed String/Substring
+ expectTrue(pair.0 > pair.1.dropLast())
+ }
case .equal:
expectEqual(pair.0, pair.1)
+ if !pair.0.isEmpty {
+ // Test mixed String/Substring
+ expectTrue(pair.0.dropLast() == pair.1.dropLast())
+ expectFalse(pair.0.dropFirst() == pair.1)
+ expectFalse(pair.0 == pair.1.dropFirst())
+ }
}
}
}
@@ -2064,6 +2078,7 @@
expectEqual(pair.0, pair.1)
}
}
+ expectEqualSequence(strings, opaqueStrings)
#endif
}
@@ -2076,10 +2091,10 @@
guard string1.count > 0 else { return }
- let expectedResult: _Ordering = string1 < string2 ? .less : (string1 > string2 ? .greater : .equal)
- let opaqueResult: _Ordering = opaqueString < string2 ? .less : (opaqueString > string2 ? .greater : .equal)
-
- expectEqual(opaqueResult, expectedResult)
+ expectEqual(string1, opaqueString)
+ expectEqual(string1 < string2, opaqueString < string2)
+ expectEqual(string1 > string2, opaqueString > string2)
+ expectEqual(string1 == string2, opaqueString == string2)
}
#endif
}
@@ -2133,6 +2148,9 @@
ComparisonTestCase(["\u{f90b}", "\u{5587}"], .equal),
ComparisonTestCase(["a\u{1D160}a", "a\u{1D158}\u{1D1C7}"], .less),
+
+ ComparisonTestCase(["a\u{305}\u{315}", "a\u{315}\u{305}"], .equal),
+ ComparisonTestCase(["a\u{315}bz", "a\u{315}\u{305}az"], .greater),
ComparisonTestCase(["\u{212b}", "\u{00c5}"], .equal),
ComparisonTestCase([
@@ -2151,10 +2169,14 @@
"ae\u{301}ae\u{301}ae\u{301}ae\u{301}ae\u{301}ae\u{301}",
"ae\u{301}ae\u{301}ae\u{301}ae\u{301}ae\u{301}ae\u{301}ae\u{301}",
"ae\u{301}ae\u{301}ae\u{301}ae\u{301}ae\u{301}ae\u{301}ae\u{301}ae\u{301}",
+ "ae\u{301}\u{302}",
"ae\u{302}",
"ae\u{302}{303}",
"ae\u{302}🧀",
"ae\u{303}",
+ "x\u{0939}x",
+ "x\u{0939}\u{093a}x",
+ "x\u{0939}\u{093a}\u{093b}x",
"\u{f90b}\u{f90c}\u{f90d}", // Normalizes to BMP scalars
"\u{FFEE}", // half width CJK dot
"🧀", // D83E DDC0 -- aka a really big scalar