Commit Graph

564 Commits

Author SHA1 Message Date
Alex Hoppen
baa20aec52 Merge pull request #67909 from nishithshah2211/imperative-fixits
[Diagnostics] Use imperative msg for protocol conformance & switch-case fixits
2023-08-21 14:40:21 -07:00
Pavel Yaskevich
4bd60aeb4e [Tests] NFC: Remove/adjust runtime metadata related test cases 2023-08-15 12:17:31 -07:00
Nishith Shah
8e2e625543 [Diagnostics] Use imperative msg for protocol conformance & switch-case fixits
This commit changes fixit messages from a question/suggestion to an
imperative message for protocol conformances and switch-case. Addresses
https://github.com/apple/swift/issues/67510.
2023-08-13 22:34:26 -07:00
Slava Pestov
3e436d316f Sema: Fix two problems in checkReferencedGenericParams() analysis
- Don't walk into the count type of a PackExpansionType, because
  when matching two PackExpansionTypes, the solver only introduces
  a shape constraint between the count types, which does not fix it
  to a concrete type.

- Similarly, don't walk into type alias substitutions, because
  only the desugared type is considered by the constraint solver.

This is mildly source breaking, in that before we let you declare
generic functions that could not be called.
2023-07-27 12:16:06 -04:00
Holly Borla
43c300408b [NFC] Update additional parameter pack tests. 2023-07-20 15:36:20 -07:00
Slava Pestov
89ad597fe3 Sema: Use getAllMembers() from collectVisibleMemberDecls()
I had to disable typo correction in one test case to get it to pass without
diagnosing a cycle as a result of Sendable checking. But that's OK, because:

- Sendable checking is prone to request cycles and needs to be redesigned
- Typo correction is turned off in production
2023-06-30 12:40:34 -04:00
Slava Pestov
1957bd6065 Sema: Reword diagnostics to say 'without a type annotation' instead of 'without more context' 2023-06-09 17:44:42 -04:00
Pavel Yaskevich
3b1f392d0a Merge pull request #65785 from angela-laar/fix-covariant-erasure-for-constrained-existentials
Fix covariant erasure for constrained existentials
2023-05-18 16:58:45 -07:00
Slava Pestov
e9e6a51c82 Unconditionally enable variadic generic types now that SE-0398 has been accepted 2023-05-15 23:32:52 -04:00
Anthony Latsis
3f629315a9 Merge pull request #65731 from AnthonyLatsis/always-print-any
ASTPrinter: Turn on explicit `any` printing for everything and remove the option to disable it
2023-05-16 03:27:36 +03:00
Angela Laar
5c818b3fd4 [Constraint System] Fix covariant erasure for constrained existentials
Constrained existentials should be type erased to an upper bound that is dependent on other type parameters.
2023-05-15 16:17:59 -07:00
Slava Pestov
4318a36be6 Sema: Availability checking for variadic generic types 2023-05-12 22:50:25 -04:00
Slava Pestov
02258c1cf3 AST: It's not 'opaque' anymore 2023-05-12 22:05:28 -04:00
Anthony Latsis
7f6d3bcd41 ASTPrinter: Turn on explicit any printing for everything and remove the option to disable it 2023-05-13 02:55:49 +03:00
Slava Pestov
8f71dc928f Sema: Diagnose variadic enums, and inheritance from variadic classes
These are just temporary limitations.
2023-05-08 12:57:33 -04:00
Slava Pestov
df5d531dc6 ASTPrinter: Fix printing of pack requirements
Also remove the flag for printing 'each' and make it always on.
2023-04-19 13:04:51 -04:00
Holly Borla
35fcc37136 Merge pull request #65134 from hborla/parameter-pack-revision
[SE-0393] Require the `repeat` keyword for generic requirement expansions.
2023-04-13 08:33:25 -07:00
Holly Borla
234b5dc660 [SE-0393] Require the repeat keyword for generic requirement expansions. 2023-04-12 22:04:01 -07:00
Anthony Latsis
8d1d526195 TypeCheckType: Fix existential 'any' migration diagnostics for extra-modular protocols 2023-04-13 03:37:25 +03:00
Sophia Poirier
a3baee9498 [Variadic Generics] fixit to remove keyword 'each' on non-pack types 2023-04-03 17:26:25 -07:00
Angela Laar
175e712b73 Merge pull request #64037 from angela-laar/fix-generic-type-paramters-implicit-some
[NameLookup] Collect implicit opaque GenericParams
2023-03-27 10:18:31 -07:00
Holly Borla
da3079de05 [ConstraintSystem] Diagnose pack expansion expressions in non-variadic contexts. 2023-03-21 21:58:05 -07:00
Angela Laar
c3eb22abda [test] test generic params with implicit some 2023-03-21 14:44:11 -07:00
Sophia Poirier
19e671b5f2 [Variadic Generics] distinctly diagnose more types of pack expansion errors + add fixits 2023-03-20 15:51:19 -07:00
Slava Pestov
2fa344bf85 AST: Tweak some variadic generic diagnostics 2023-03-15 23:04:50 -04:00
Anthony Latsis
4d2b2f6fee Sema: Allow member type expressions rooted on non-identifier qualifiers to omit .self until Swift 6 2023-03-09 04:55:25 +03:00
Kavon Farvardin
d69c0378a6 add a Copyable conformance for PackExpansionType 2023-03-04 11:42:09 -08:00
Sophia Poirier
70cffb06f3 [Variadic Generics] type parameter pack syntax change: T... -> each T 2023-03-02 14:42:28 -08:00
Angela Laar
7ac96f89a8 Merge pull request #63851 from angela-laar/fix-existential-parameterized-protocol-diagnostic
Fix existential parameterized protocol diagnostic
2023-02-23 08:17:38 -08:00
Angela Laar
4b64dc9df7 [test] Add tests 2023-02-22 17:09:32 -08:00
Angela Laar
020281ac42 Merge pull request #63468 from angela-laar/implicit-some-reconstruction
[Sema] Record opaque type decls for type reconstruction after creation instead of in the parser
2023-02-22 11:27:42 -08:00
Angela Laar
59d62be759 Only add explicit opaque types to module interfaces 2023-02-20 18:21:33 -08:00
Daniel Rodríguez Troitiño
9f922206d0 Add REQUIRES: distributed to runtime_discoverable_attrs_distributed.swift (#63669)
The test is using the distributed capabilities, but it is not marked as
such. If someone is not building with the distributed features enabled,
the test will fail for them.
2023-02-15 08:40:51 -08:00
Angela Laar
0eb072c1d1 Merge pull request #63542 from angela-laar/fix-type-alias-implicit-some
[NameLookup] Type Aliases should resolve as opaque
2023-02-13 10:48:50 -08:00
Anthony Latsis
dbd3ebe87b Merge pull request #63574 from Rajveer100/branch-for-issue-62518
Changed 'protocols' to 'type constraints' for obsoleted protocol composition syntax error
2023-02-13 13:34:21 +03:00
Rajveer
8e4fd23038 Changed 'protocols' to 'type constraints' for obsoleted protocol composition syntax error
Fixes #62518
2023-02-11 11:38:55 +05:30
Rajveer
33bf9d2d0b [Sema] Align error messages for failure to infer generic parameter and opaque result type
Fixes #63291.
2023-02-11 11:36:16 +05:30
Angela Laar
26c62b1635 [NameLookup] Type Aliases should resolve as opaque
Type aliases for plain protocols should resolve as
opaque types with implicit some feature flag

Fixes rdar://101403690
2023-02-10 09:40:54 -08:00
Pavel Yaskevich
5dded3da73 [Tests] NFC: Remove test-cases associated with TypeWrappers feature 2023-02-08 10:14:34 -08:00
Pavel Yaskevich
dd24033017 Merge pull request #63417 from xedin/attach-source-info-to-reflection-metadata-inits
[Sema] RuntimeMetadata: Attach source information to synthesized initializers
2023-02-06 09:37:09 -08:00
Konrad `ktoso` Malawski
12d1ebc4e7 fix the linkage of async func ptr to distributed accessors 2023-02-06 18:39:58 +09:00
Konrad `ktoso` Malawski
28e700d0c1 move tests 2023-02-06 14:19:46 +09:00
Konrad `ktoso` Malawski
a629fed157 [Distributed][CustomRuntimeAttrs] Add distributed actor test cases
Making sure we can use custom runtime attributes on a `distributed actor` even if only on distributed methods.

It seems we can't do this on non distributed methods, as the call is made cross actor so the distributed isolation prevents it. Not sure if that should be possible anyway -- as long as distributed funcs can be annotated the most important part works <3
2023-02-06 14:19:46 +09:00
Angela Laar
cba738961b [Sema] Prevent duplicate diagnostics in oqaque types 2023-02-03 18:12:07 -08:00
Angela Laar
c837baa313 [Sema] Diagnose DisallowedExistential in type resolution 2023-02-03 14:40:50 -08:00
Angela Laar
2c9ada1cef Test Explicit Existential with Implicit Some 2023-02-03 14:40:50 -08:00
Pavel Yaskevich
50c1f97656 [Sema] RuntimeMetadata: Attach source information to synthesized initializers
All the locations point to the attribute itself, expect to the custom arguments
they all have real locations.
2023-02-03 12:36:37 -08:00
Pavel Yaskevich
7a81eb3810 Merge pull request #63274 from xedin/runtime-metadata-impl-alignment
[AST/Sema] RuntimeMetadata: Align implementation with proposal
2023-02-01 12:37:24 -08:00
Anthony Latsis
3302b27df8 Merge pull request #62775 from AnthonyLatsis/sugar-type-members-2
Parser: Support member types with non-identifier qualifiers
2023-02-01 02:07:12 +03:00
Pavel Yaskevich
67b74a0633 [Sema] RuntimeMetadata: Diagnose missing explicit reflection metadata attributes
Diagnose situations where a sub-class or a protocol do not have all
of the reflection metadata attributes required by a superclass.

Resolves: rdar://103990788
2023-01-30 14:14:47 -08:00