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> {
735
735
void printType (Type T) { printTypeWithOptions (T, Options); }
736
736
737
737
void printTransformedTypeWithOptions (Type T, PrintOptions options) {
738
- if (CurrentType) {
738
+ if (CurrentType && Current ) {
739
739
if (T->hasArchetype ()) {
740
740
// Get the interface type, since TypeLocs still have
741
741
// contextual types in them.
@@ -1527,7 +1527,7 @@ void PrintAST::printSingleDepthOfGenericSignature(
1527
1527
(flags & SwapSelfAndDependentMemberType);
1528
1528
1529
1529
SubstitutionMap subMap;
1530
- if (CurrentType) {
1530
+ if (CurrentType && Current ) {
1531
1531
if (!CurrentType->isExistentialType ()) {
1532
1532
auto *DC = Current->getInnermostDeclContext ()->getInnermostTypeContext ();
1533
1533
auto *M = DC->getParentModule ();
Original file line number Diff line number Diff line change 66
66
67
67
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CONFORM_SEQUENCE | %FileCheck %s -check-prefix=CONFORM_SEQUENCE
68
68
69
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GENERIC_CLOSUREARG | %FileCheck %s -check-prefix=GENERIC_CLOSUREARG
70
+
69
71
// NO_STDLIB_PRIVATE: Begin completions
70
72
// NO_STDLIB_PRIVATE: End completions
71
73
@@ -291,3 +293,13 @@ class TestSequence : Sequence {
291
293
// CONFORM_SEQUENCE-DAG: Decl[InstanceMethod]/Super/IsSystem: func withContiguousStorageIfAvailable<R>(_ body: (UnsafeBufferPointer<Element>) throws -> R) rethrows -> R? {|};
292
294
// CONFORM_SEQUENCE: End completions
293
295
}
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