Commit Graph

11 Commits

Author SHA1 Message Date
Allan Shortlidge
98b34c6ff6 Sema: Correctly treat overloads in unavailable extensions as unavailable.
Instead of checking for unavailability attributes directly in the solver, which
does not correctly handle members of unavailable extensions, query
`checkDeclarationAvailability()` instead. By using the same underlying logic as
the availability checker the constraint solver can be confident in the accuracy
of this result.

Resolves rdar://87403752.
2024-11-02 17:15:11 -07:00
Allan Shortlidge
cddd86f709 ConstraintSystem: Add a test case for rdar://101814209. 2022-11-01 17:53:06 -07:00
Allan Shortlidge
429f19a4b6 Revert "[ConstraintSystem] Extend availability check to cover unavailable extensions."
This reverts commit 6de6de2e3a.
2022-11-01 17:00:33 -07:00
Allan Shortlidge
6de6de2e3a [ConstraintSystem] Extend availability check to cover unavailable extensions.
Instead of checking for unavailability attributes directly in the solver, use `AvailableAttr::isUnavailable` which checks the enclosing extension too, if necessary.

Resolves rdar://92364955
2022-09-21 18:26:57 -07:00
Anthony Latsis
7fc8377e1c Gardening: Migrate test suite to GH issues: Constraints (1/5) 2022-08-17 15:21:51 +03:00
Pavel Yaskevich
c05a07af05 Revert "[ConstraintSystem] Extend availability check to cover unavailable ext…" 2022-04-29 15:19:25 -07:00
Pavel Yaskevich
9a32db7871 [ConstraintSystem] Extend availability check to cover unavailable extensions
The solver used to check availability attribute on the declaration
itself, a better approach is to go through `AvailableAttr::isUnavailable`
because that also covers unavailable extensions.

Resolves: rdar://92364955
2022-04-27 14:00:12 -07:00
Josh Soref
8b89b4c995 Spelling constraints (#42548)
* spelling: availability

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: conditional

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: deferred

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: disambiguate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: failed

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interferes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: magnify

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurrences

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overload

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: redeclarations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: simplification

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: string

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-22 09:43:26 -07:00
Hamish Knight
be607d15b3 [CS] Introduce performSyntacticDiagnosticsForTarget
Add a function that deals with invoking syntactic
diagnostics for all the expressions involved in
a SolutionApplicationTarget.

Resolves SR-13260
Resolves rdar://65903005
2020-07-21 15:51:07 -07:00
Pavel Yaskevich
4c600843d6 [ConstraintSystem] Check availability as part of resolving overload choice
This is a follow up to changes related to contextual availability
(https://github.com/apple/swift/pull/29921) which increased score
for unavailable declarations only if they were overloaded but
overlooked a case of a single unavailable choice.

Resolve: rdar://problem/60047439
2020-03-05 00:35:47 -08:00
Mark Lacey
65e338ea4a [Constraint solver] Do not allow unavailable decls to be favored.
There is a short-circuiting hack in the constraint solver that speeds up
solving, but isn't generally sound. If we allow unavailable decls to be
considered "favored", this can fire and result in our choosing a
solution that involves the unavailable decl where other solutions exist.

Fixes rdar://problem/32570734.
2017-06-06 13:38:36 -07:00