mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Special-case recording of Bind constraint in PreparedOverload
This commit is contained in:
@@ -71,6 +71,9 @@ struct PreparedOverloadChange {
|
||||
/// A generic requirement was opened to a constraint.
|
||||
AddedConstraint,
|
||||
|
||||
/// Special case of a Bind constraint.
|
||||
AddedBindConstraint,
|
||||
|
||||
/// A mapping of generic parameter types to type variables
|
||||
/// was recorded.
|
||||
OpenedTypes,
|
||||
@@ -98,6 +101,11 @@ struct PreparedOverloadChange {
|
||||
/// For ChangeKind::AddedConstraint.
|
||||
Constraint *TheConstraint;
|
||||
|
||||
struct {
|
||||
TypeBase *FirstType;
|
||||
TypeBase * SecondType;
|
||||
} Bind;
|
||||
|
||||
/// For ChangeKind::OpenedTypes.
|
||||
struct {
|
||||
const OpenedType *Data;
|
||||
@@ -192,6 +200,14 @@ struct PreparedOverloadBuilder {
|
||||
Changes.push_back(change);
|
||||
}
|
||||
|
||||
void addedBindConstraint(Type firstType, Type secondType) {
|
||||
PreparedOverload::Change change;
|
||||
change.Kind = PreparedOverload::Change::AddedBindConstraint;
|
||||
change.Bind.FirstType = firstType.getPointer();
|
||||
change.Bind.SecondType = secondType.getPointer();
|
||||
Changes.push_back(change);
|
||||
}
|
||||
|
||||
void openedTypes(ArrayRef<OpenedType> replacements) {
|
||||
PreparedOverload::Change change;
|
||||
change.Kind = PreparedOverload::Change::OpenedTypes;
|
||||
|
||||
Reference in New Issue
Block a user