@@ -137,11 +137,6 @@ enum class ConstraintKind : char {
137
137
// / name, and the type of that member, when referenced as a value, is the
138
138
// / second type.
139
139
UnresolvedValueMember,
140
- // / The first type conforms to the protocol in which the member requirement
141
- // / resides. Once the conformance is resolved, the value witness will be
142
- // / determined, and the type of that witness, when referenced as a value,
143
- // / will be bound to the second type.
144
- ValueWitness,
145
140
// / The first type can be defaulted to the second (which currently
146
141
// / cannot be dependent). This is more like a type property than a
147
142
// / relational constraint.
@@ -411,18 +406,11 @@ class Constraint final : public llvm::ilist_node<Constraint>,
411
406
// / The type of the member.
412
407
Type Second;
413
408
414
- union {
415
- // / If non-null, the name of a member of the first type is that
416
- // / being related to the second type.
417
- // /
418
- // / Used for ValueMember an UnresolvedValueMember constraints.
419
- DeclNameRef Name;
420
-
421
- // / If non-null, the member being referenced.
422
- // /
423
- // / Used for ValueWitness constraints.
424
- ValueDecl *Ref;
425
- } Member;
409
+ // / If non-null, the name of a member of the first type is that
410
+ // / being related to the second type.
411
+ // /
412
+ // / Used for ValueMember an UnresolvedValueMember constraints.
413
+ DeclNameRef Name;
426
414
427
415
// / The DC in which the use appears.
428
416
DeclContext *UseDC;
@@ -537,12 +525,6 @@ class Constraint final : public llvm::ilist_node<Constraint>,
537
525
FunctionRefKind functionRefKind,
538
526
ConstraintLocator *locator);
539
527
540
- // / Create a new value witness constraint.
541
- static Constraint *createValueWitness (
542
- ConstraintSystem &cs, ConstraintKind kind, Type first, Type second,
543
- ValueDecl *requirement, DeclContext *useDC,
544
- FunctionRefKind functionRefKind, ConstraintLocator *locator);
545
-
546
528
// / Create an overload-binding constraint.
547
529
static Constraint *createBindOverload (ConstraintSystem &cs, Type type,
548
530
OverloadChoice choice,
@@ -690,7 +672,6 @@ class Constraint final : public llvm::ilist_node<Constraint>,
690
672
691
673
case ConstraintKind::ValueMember:
692
674
case ConstraintKind::UnresolvedValueMember:
693
- case ConstraintKind::ValueWitness:
694
675
case ConstraintKind::PropertyWrapper:
695
676
return ConstraintClassification::Member;
696
677
@@ -730,7 +711,6 @@ class Constraint final : public llvm::ilist_node<Constraint>,
730
711
731
712
case ConstraintKind::ValueMember:
732
713
case ConstraintKind::UnresolvedValueMember:
733
- case ConstraintKind::ValueWitness:
734
714
return Member.First ;
735
715
736
716
case ConstraintKind::SyntacticElement:
@@ -752,7 +732,6 @@ class Constraint final : public llvm::ilist_node<Constraint>,
752
732
753
733
case ConstraintKind::ValueMember:
754
734
case ConstraintKind::UnresolvedValueMember:
755
- case ConstraintKind::ValueWitness:
756
735
return Member.Second ;
757
736
758
737
default :
@@ -778,20 +757,13 @@ class Constraint final : public llvm::ilist_node<Constraint>,
778
757
DeclNameRef getMember () const {
779
758
assert (Kind == ConstraintKind::ValueMember ||
780
759
Kind == ConstraintKind::UnresolvedValueMember);
781
- return Member.Member .Name ;
782
- }
783
-
784
- // / Retrieve the requirement being referenced by a value witness constraint.
785
- ValueDecl *getRequirement () const {
786
- assert (Kind == ConstraintKind::ValueWitness);
787
- return Member.Member .Ref ;
760
+ return Member.Name ;
788
761
}
789
762
790
763
// / Determine the kind of function reference we have for a member reference.
791
764
FunctionRefKind getFunctionRefKind () const {
792
765
if (Kind == ConstraintKind::ValueMember ||
793
- Kind == ConstraintKind::UnresolvedValueMember ||
794
- Kind == ConstraintKind::ValueWitness)
766
+ Kind == ConstraintKind::UnresolvedValueMember)
795
767
return static_cast <FunctionRefKind>(TheFunctionRefKind);
796
768
797
769
// Conservative answer: drop all of the labels.
@@ -851,8 +823,7 @@ class Constraint final : public llvm::ilist_node<Constraint>,
851
823
// / Retrieve the DC in which the member was used.
852
824
DeclContext *getMemberUseDC () const {
853
825
assert (Kind == ConstraintKind::ValueMember ||
854
- Kind == ConstraintKind::UnresolvedValueMember ||
855
- Kind == ConstraintKind::ValueWitness);
826
+ Kind == ConstraintKind::UnresolvedValueMember);
856
827
return Member.UseDC ;
857
828
}
858
829
0 commit comments