Commit Graph

13 Commits

Author SHA1 Message Date
Alejandro Alonso
9f2aec5286 Add -verify-ignore-unrelated to a few tests 2025-10-07 13:16:36 -07:00
Henrik G. Olsson
cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00
Slava Pestov
cd5ecbee16 Sema: Implement missing part of SE-0346
The proposal states that this should work, but this was never
implemented:

    protocol P<A> {
      associatedtype A
    }

    struct S: P<Int> {}

- Fixes https://github.com/swiftlang/swift/issues/62906.
- Fixes rdar://91842338.
2025-06-03 17:28:19 -04:00
Slava Pestov
7c7caa2088 Sema: Fix regression with 'Failure' type witness inference hack
We have a special hack to infer the 'Failure' type witness in
'AsyncIteratorProtocol' by considering the type of 'next()'
witness.

In eaf06eae0e I added a check to
fix some assertions that could happen if 'next()' was witnessed
by a declaration in a protocol extension or superclass, which
has a different generic signature.

However my check was too narrow, because it also prohibited
this form of inference when 'next()' was in a different
extension of the same nominal type.

Allow this again.

Fixes https://github.com/swiftlang/swift/issues/79367.
Fixes rdar://problem/145341658.
2025-04-03 17:34:31 -04:00
Slava Pestov
b26c59962b Sema: Fix handling of getter typed throws in associated type inference
We must replace type parameters with archetypes in the thrown error type
of the witness. The requirement type remains an interface type.
2025-04-01 17:21:32 -04:00
Daniel Rodríguez Troitiño
ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Allan Shortlidge
6f55aa4170 Tests: Remove -disable-availability-checking in tests that use opaque types.
Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for
deployment to the minimum OS versions required for use of opaque types, instead
of disabling availability checking.
2024-10-19 19:39:18 -07:00
Slava Pestov
df1b4bc3ba Fix name of test case 2024-08-29 16:18:14 -04:00
Slava Pestov
8c8b700ece Fix name of test case and move it to test/Generics/ 2024-08-29 16:18:14 -04:00
Alex Hoppen
577727ad55 Remove DiagnosticsEditorMode
Migrate the last diagnostic to be independent of `DiagnosticEditorMode` and remove that option.

rdar://133111163
2024-08-14 11:24:31 -07:00
Alex Hoppen
66104395d7 [Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`.

To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing.

rdar://129283608
2024-08-07 14:01:30 -07:00
Slava Pestov
609f436b61 Sema: Fix crash with circular type witness edge case
Fixes https://github.com/swiftlang/swift/issues/75371
2024-08-03 15:51:57 -04:00
Slava Pestov
557300ba48 Move associated type inference tests into their own directory 2024-06-28 17:50:24 -04:00