swift
Sema: Filter out protocol extension default implementations of operators
#78225
Merged

Sema: Filter out protocol extension default implementations of operators #78225

slavapestov
slavapestov189 days ago (edited 189 days ago)

In solution ranking we always prefer a protocol operator over
a protocol extension operator. So if their interface types are
identical, any set of fixed type assignments that satisfies
the default implementation will also satisfy the protocol requirement.

Thus, we can filter out the default implementation early and not
consider it at all.

This speeds up expressions involving bitwise shift operators,
for example.

slavapestov slavapestov force pushed from a3af4219 to a63da5b4 189 days ago
slavapestov AST: Add isBitwiseOperator() and isShiftOperator() methods to Identifier
d1f34dcf
slavapestov slavapestov force pushed from a63da5b4 to 14a9f2f5 189 days ago
xedin
xedin approved these changes on 2024-12-16
slavapestov slavapestov force pushed from 14a9f2f5 to 07e9fa08 189 days ago
slavapestov slavapestov marked this pull request as ready for review 189 days ago
slavapestov slavapestov requested a review from hborla hborla 189 days ago
slavapestov Sema: Extend DisjunctionStep::shouldSkip() hack to cover ~ & | ^ << >>
27812856
slavapestov slavapestov force pushed from 07e9fa08 to 27812856 189 days ago
slavapestov
slavapestov189 days ago

@swift-ci Please smoke test

slavapestov
slavapestov189 days ago

@swift-ci Please test source compatibility

xedin
xedin189 days ago

@swift-ci please test Linux platform

slavapestov slavapestov merged 8eb9e745 into main 188 days ago

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone