File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -735,7 +735,7 @@ class PrintAST : public ASTVisitor<PrintAST> {
735735 void printType (Type T) { printTypeWithOptions (T, Options); }
736736
737737 void printTransformedTypeWithOptions (Type T, PrintOptions options) {
738- if (CurrentType) {
738+ if (CurrentType && Current ) {
739739 if (T->hasArchetype ()) {
740740 // Get the interface type, since TypeLocs still have
741741 // contextual types in them.
@@ -1527,7 +1527,7 @@ void PrintAST::printSingleDepthOfGenericSignature(
15271527 (flags & SwapSelfAndDependentMemberType);
15281528
15291529 SubstitutionMap subMap;
1530- if (CurrentType) {
1530+ if (CurrentType && Current ) {
15311531 if (!CurrentType->isExistentialType ()) {
15321532 auto *DC = Current->getInnermostDeclContext ()->getInnermostTypeContext ();
15331533 auto *M = DC->getParentModule ();
Original file line number Diff line number Diff line change 6666
6767// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CONFORM_SEQUENCE | %FileCheck %s -check-prefix=CONFORM_SEQUENCE
6868
69+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_CLOSUREARG | %FileCheck %s -check-prefix=GENERIC_CLOSUREARG
70+
6971// NO_STDLIB_PRIVATE: Begin completions
7072// NO_STDLIB_PRIVATE: End completions
7173
@@ -291,3 +293,13 @@ class TestSequence : Sequence {
291293// CONFORM_SEQUENCE-DAG: Decl[InstanceMethod]/Super/IsSystem: func withContiguousStorageIfAvailable<R>(_ body: (UnsafeBufferPointer<Element>) throws -> R) rethrows -> R? {|};
292294// CONFORM_SEQUENCE: End completions
293295}
296+
297+ public func rdar_70057258< T> ( _ f: T ) { }
298+ extension Result {
299+ public init ( _ value: Success ? ) {
300+ self = value. map ( #^GENERIC_CLOSUREARG^#)
301+ }
302+ }
303+ // GENERIC_CLOSUREARG: Begin completions
304+ // GENERIC_CLOSUREARG: Decl[FreeFunction]/CurrModule/TypeRelation[Convertible]: rdar_70057258(_:)[#<T> (T) -> ()#]; name=rdar_70057258(_:)
305+ // GENERIC_CLOSUREARG: End completions
You can’t perform that action at this time.
0 commit comments