Merge pull request #10797 from akyrtzi/sourcekit-ignore-index-store-flag-4.0

[4.0][SourceKit] Ignore the index-store-path flag for the sourcekitd requests
diff --git a/lib/Sema/CSDiag.cpp b/lib/Sema/CSDiag.cpp
index 1244b36..ae3b531 100644
--- a/lib/Sema/CSDiag.cpp
+++ b/lib/Sema/CSDiag.cpp
@@ -7537,6 +7537,8 @@
   auto performLookup = [&](Identifier componentName, SourceLoc componentNameLoc,
                            Type &lookupType) -> LookupResult {
     assert(currentType && "Non-beginning state must have a type");
+    if (!currentType->mayHaveMembers())
+      return LookupResult();
 
     // Determine the type in which the lookup should occur. If we have
     // a bridged value type, this will be the Objective-C class to
diff --git a/validation-test/compiler_crashers_2_fixed/0112-rdar33135487.swift b/validation-test/compiler_crashers_2_fixed/0112-rdar33135487.swift
new file mode 100644
index 0000000..a6acac0
--- /dev/null
+++ b/validation-test/compiler_crashers_2_fixed/0112-rdar33135487.swift
@@ -0,0 +1,8 @@
+// RUN: not %target-swift-frontend %s -typecheck
+
+enum State<StateType> {
+  func put<StateType>() -> StateType {}
+  func put<T>(keyPath: WritableKeyPath<StateType, T>, projection: T) {
+    put(keyPath: \.age, projection: {})
+  }
+}