                                        setter: setter,
                                        arguments: arguments,
                                        externalArgs: externalArgs)
+    // Note: For this function and the ones below, modification of structOffset
+    // is omitted since these types of KeyPaths won't have a pureStruct
+    // offset anyway.
+    isPureStruct.append(contentsOf: instantiateVisitor.isPureStruct)
     checkSizeConsistency()
   }
   mutating func visitOptionalChainComponent() {
     sizeVisitor.visitOptionalChainComponent()
     instantiateVisitor.visitOptionalChainComponent()
+    isPureStruct.append(contentsOf: instantiateVisitor.isPureStruct)
     checkSizeConsistency()
   }
   mutating func visitOptionalWrapComponent() {
     sizeVisitor.visitOptionalWrapComponent()
     instantiateVisitor.visitOptionalWrapComponent()
+    isPureStruct.append(contentsOf: instantiateVisitor.isPureStruct)
     checkSizeConsistency()
   }
   mutating func visitOptionalForceComponent() {
     sizeVisitor.visitOptionalForceComponent()
     instantiateVisitor.visitOptionalForceComponent()
+    isPureStruct.append(contentsOf: instantiateVisitor.isPureStruct)
     checkSizeConsistency()
   }
   mutating func visitIntermediateComponentType(metadataRef: MetadataReference) {
     sizeVisitor.visitIntermediateComponentType(metadataRef: metadataRef)
     instantiateVisitor.visitIntermediateComponentType(metadataRef: metadataRef)
+    isPureStruct.append(contentsOf: instantiateVisitor.isPureStruct)
     checkSizeConsistency()
   }
 
   mutating func finish() {
     sizeVisitor.finish()
     instantiateVisitor.finish()
+    isPureStruct.append(contentsOf: instantiateVisitor.isPureStruct)
     checkSizeConsistency()
   }
 

                                            offset: offset)
    checkSizeConsistency()
    structOffset = instantiateVisitor.structOffset
    isPureStruct = instantiateVisitor.isPureStruct
  }
  mutating func visitComputedComponent(mutating: Bool,
                                   idKind: KeyPathComputedIDKind,

    isPureStruct = isPureStruct && value
  }

  if isPureStruct {
      offset = walker.structOffset
  }
