Commit Graph

6 Commits

Author SHA1 Message Date
Kathy Gray
5e407bce89 Diagnostics change for ambiguous overloads previously specifying 'this'
Updates the message to use the type or ValueDecl instead of this on previous 'Found this candidate' messages
Note: doees not yet change all test cases so more tests are failing

Improve Diagnostic message on overload ambiguitiy

Remove messages that say 'found this candidate' in favour of providing the type for the candidate to aid in selection when the candidates are presented in a dialogue window.

Fix more tests
2025-10-10 17:46:22 +01:00
Holly Borla
5eb16ad3de [Conformance] Always downgrade redundant conformances to marker protocols to
a warning.

Previous compiler versions allowed this, so we should stage the change in as
a warning. This was already a warning across modules, so this change only impacts
redundant conformances to marker protocols within a module. This code also isn't
particularly harmful, because marker protocols don't have requirements, so there
isn't the same risk of unexpected behavior as other redundant conformances.
2024-07-23 14:08:14 -07:00
Doug Gregor
bd9b18ef65 Add test for FB6114209 / rdar://problem/51413553
This was fixed by pull request #26174, but the test case there was
specific to property wrappers, while the fix also addresses issues
with other ambiguity name lookups such as protocol names in an
inheritance clause.
2019-07-19 06:53:53 -07:00
Huon Wilson
2e5799e26b [Sema] Diagnose redundant conditional conformances more specifically.
We don't allow things like

    extension Type: P where Param: P {}
    extension Type: P where Param: Q {}

or

    extension Type: P where Param == Int {}
    extension Type: P where Param == Float {}

or

    extension Type: P where Param: P {}
    extension Type: P where Param == SomethingThatIsntP {}

and the default error message "redundant conformance" message doesn't convey
this very well.

Fixes rdar://problem/36262409.
2018-04-27 11:50:17 +10:00
Saleem Abdulrasool
b67d5f0cf7 test: convert rm -rf && mkdir -p into %empty-directory
This converts the instances of the pattern for which we have a proper
substitution in lit.  This will make it easier to replace it
appropriately with Windows equivalents.
2018-03-06 14:30:54 -08:00
Doug Gregor
f7bccb0e68 [Type checker] Downgrade some "redundant conformance" errors to warnings.
When an extension introduces a conformance that already exists, the
type checker will reject the conformance and then ignore it. In cases
where the original conformance is in the same module as the type or
protocol (but the new, redundant conformance is in some other module),
downgrade this error to a warning. This helps with library-evolution
cases where a library omitted a particular conformance for one of its
own types/protocols in a previous version, then introduces it in a new
version.

The specific driver for this is the conformance of String to
Collection, which affects source compatibility. Fixes
rdar://problem/31104415.
2017-05-01 13:22:15 -07:00