Skip to content

AST: Remove unused computation from IsBindableVisitor #71730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions include/swift/AST/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1146,25 +1146,16 @@ class alignas(1 << TypeAlignInBits) TypeBase
/// function with each archetype-to-substituted-type binding. The callback
/// may return a new type to substitute into the result type, or return
/// CanType() to error out of the operation. Each invocation of the callback
/// receives three arguments:
/// receives two arguments:
/// - The `orig` archetype from a position in `this` type.
/// - The `subst` type in the same structural position of `ty` that is trying to be bound
/// to `orig`.
/// - The `upperBound` archetype, which if set, indicates the minimum set of constraints
/// that any type substituted in this structural position must conform to. May be null,
/// indicating an unconstrained context.
/// - If `upperBound` is set, then the `substConformances` array will contain the
/// protocol conformances for `subst` to each of the protocol requirements
/// on `upperBound` in `getConformsTo` order.
/// - The `subst` type in the same structural position of `ty` that is trying
/// to be bound to `orig`.
///
/// Returns the substituted type, or a null CanType() if this type
/// is not bindable to the substituted type, or the callback returns
/// CanType().
CanType substituteBindingsTo(Type ty,
llvm::function_ref<CanType(ArchetypeType *orig,
CanType subst,
ArchetypeType *upperBound,
ArrayRef<ProtocolConformanceRef> substConformances)> substFn);
llvm::function_ref<CanType(ArchetypeType *orig, CanType subst)> substFn);

/// Determines whether this type is similar to \p other as defined by
/// \p matchOptions.
Expand Down
Loading