@@ -300,85 +300,6 @@ ProtocolDecl *Constraint::getProtocol() const {
300300 return Types.Second ->castTo <ProtocolType>()->getDecl ();
301301}
302302
303- Constraint *Constraint::clone (ConstraintSystem &cs) const {
304- switch (getKind ()) {
305- case ConstraintKind::Bind:
306- case ConstraintKind::Equal:
307- case ConstraintKind::BindParam:
308- case ConstraintKind::BindToPointerType:
309- case ConstraintKind::Subtype:
310- case ConstraintKind::Conversion:
311- case ConstraintKind::BridgingConversion:
312- case ConstraintKind::ArgumentConversion:
313- case ConstraintKind::OperatorArgumentConversion:
314- case ConstraintKind::SubclassOf:
315- case ConstraintKind::ConformsTo:
316- case ConstraintKind::LiteralConformsTo:
317- case ConstraintKind::TransitivelyConformsTo:
318- case ConstraintKind::CheckedCast:
319- case ConstraintKind::DynamicTypeOf:
320- case ConstraintKind::EscapableFunctionOf:
321- case ConstraintKind::OpenedExistentialOf:
322- case ConstraintKind::SelfObjectOfProtocol:
323- case ConstraintKind::DynamicCallableApplicableFunction:
324- case ConstraintKind::OptionalObject:
325- case ConstraintKind::Defaultable:
326- case ConstraintKind::OneWayEqual:
327- case ConstraintKind::OneWayBindParam:
328- case ConstraintKind::FallbackType:
329- case ConstraintKind::UnresolvedMemberChainBase:
330- case ConstraintKind::PropertyWrapper:
331- case ConstraintKind::BindTupleOfFunctionParams:
332- case ConstraintKind::PackElementOf:
333- case ConstraintKind::ShapeOf:
334- case ConstraintKind::ExplicitGenericArguments:
335- case ConstraintKind::SameShape:
336- case ConstraintKind::MaterializePackExpansion:
337- case ConstraintKind::LValueObject:
338- return create (cs, getKind (), getFirstType (), getSecondType (), getLocator ());
339-
340- case ConstraintKind::ApplicableFunction:
341- return createApplicableFunction (
342- cs, getFirstType (), getSecondType (), getTrailingClosureMatching (),
343- getLocator ());
344-
345- case ConstraintKind::BindOverload:
346- return createBindOverload (cs, getFirstType (), getOverloadChoice (),
347- getOverloadUseDC (), getLocator ());
348-
349- case ConstraintKind::ValueMember:
350- case ConstraintKind::UnresolvedValueMember:
351- return createMember (cs, getKind (), getFirstType (), getSecondType (),
352- getMember (), getMemberUseDC (), getFunctionRefKind (),
353- getLocator ());
354-
355- case ConstraintKind::ValueWitness:
356- return createValueWitness (
357- cs, getKind (), getFirstType (), getSecondType (), getRequirement (),
358- getMemberUseDC (), getFunctionRefKind (), getLocator ());
359-
360- case ConstraintKind::Disjunction:
361- return createDisjunction (
362- cs, getNestedConstraints (), getLocator (),
363- static_cast <RememberChoice_t>(shouldRememberChoice ()));
364-
365- case ConstraintKind::Conjunction:
366- return createConjunction (cs, getNestedConstraints (), IsIsolated,
367- getLocator (), getTypeVariables ());
368-
369- case ConstraintKind::KeyPath:
370- case ConstraintKind::KeyPathApplication:
371- return create (cs, getKind (), getFirstType (), getSecondType (), getThirdType (),
372- getLocator ());
373-
374- case ConstraintKind::SyntacticElement:
375- return createSyntacticElement (cs, getSyntacticElement (), getLocator (),
376- isDiscardedElement ());
377- }
378-
379- llvm_unreachable (" Unhandled ConstraintKind in switch." );
380- }
381-
382303void Constraint::print (llvm::raw_ostream &Out, SourceManager *sm,
383304 unsigned indent, bool skipLocator) const {
384305 // Print all type variables as $T0 instead of _ here.
0 commit comments