diff --git a/lib/Sema/CSApply.cpp b/lib/Sema/CSApply.cpp index 387c39025f4cb..57fe6d3ee627a 100644 --- a/lib/Sema/CSApply.cpp +++ b/lib/Sema/CSApply.cpp @@ -7577,7 +7577,11 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType, // FIXME: handle unwrapping everywhere else assert(!unwrapResult); - assert(!cs.getType(fn)->is()); + // If this is an UnresolvedType in the system, preserve it. + if (cs.getType(fn)->is()) { + cs.setType(apply, cs.getType(fn)); + return apply; + } // We have a type constructor. auto metaTy = cs.getType(fn)->castTo(); diff --git a/test/SourceKit/CodeComplete/rdar75200446.swift b/test/SourceKit/CodeComplete/rdar75200446.swift new file mode 100644 index 0000000000000..33a256ce2115f --- /dev/null +++ b/test/SourceKit/CodeComplete/rdar75200446.swift @@ -0,0 +1,3 @@ +// RUN: %sourcekitd-test -req=complete -pos=3:14 %s -- %s + +.undefined() /*HERE*/