Commit Graph

46689 Commits

Author SHA1 Message Date
Kathy Gray
e25cfc6d23 Expand support for PackExpansion type in requirements maching
Types where pack expansion required nested subsitution could cause the compiler to crash rather than properly expanding the pack. Both for populated types and infinityly expanding types which should generate an error.
This expands the support for these to generate more errors and populated types, and correspondingly expands the test suite
2025-10-10 17:46:22 +01:00
Kathy Gray
ce9368c39c Diagnostics change for ambiguous overloads previously specifying 'this'
Updates the message to use the type or ValueDecl instead of saying 'this' on 'Found this candidate' messages to provide more information where possible in selecting overloads

Per comment during draft iteration uses getInterfaceType and adds removeSelfParam to ValueDecl.t

Migrate to calling interfaceType and remove SelfParam

Update tests to reflect type information in ambiguity resolution

All but 5 tests now passing. Those 5 either do not refer to overloading errors or do pass even when modified to accept type specification

Move implementation to ValueDecl now that tests largely pass
2025-10-10 17:46:22 +01:00
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
John McCall
e5b6a88c5e Merge pull request #84181 from rjmccall/isolation-fixes
Isolation fixes for closures and defer bodies
2025-09-10 08:39:09 -04:00
Hamish Knight
f8218e3254 Merge pull request #83777 from hamishknight/ext-cleanup
[Sema] Clean up extension binding a little
2025-09-10 09:37:20 +01:00
Hamish Knight
872176bdd1 Merge pull request #84149 from hamishknight/case-and-pat
A few pattern cleanups + fixes
2025-09-10 09:36:22 +01:00
Slava Pestov
0063c3c522 Merge pull request #84131 from slavapestov/remove-covariant-result-type-post-cleanup
Sema: Clean up getTypeOfMemberReference() and buildMemberRef()
2025-09-10 01:39:38 -04:00
Slava Pestov
60246a2889 Sema: Further split up getTypeOfMemberTypeReference() 2025-09-09 18:58:10 -04:00
Slava Pestov
6dc2e7558d Sema: Don't modify openedType in getMemberReferenceTypeFromOpenedType() 2025-09-09 18:58:09 -04:00
Slava Pestov
45e3f1bc00 AST: Add TypeBase::eraseDynamicSelfType() 2025-09-09 18:58:09 -04:00
Owen Voorhees
c849ae2727 Merge pull request #83963 from owenv/exclusivity-docs
Add documentation to static exclusivity diagnostics
2025-09-09 15:44:08 -07:00
Charles Zablit
ff62407c1b Merge pull request #84169 from charles-zablit/charles-zablit/demangling/make-printRoot-virtual
[demangling] make printRoot virtual
2025-09-09 23:37:12 +01:00
Hamish Knight
17fe3de8c7 [Sema] Clean up extension binding a little
- Turn `BindExtensionsForIDEInspectionRequest` into the main extension
binding request.
- Change `ExtendedNominalRequest` such that it's no longer what
extension binding calls into to do the name lookup, instead it calls
directly into `computeExtendedNominal`. `getExtendedNominal` can
then be the entrypoint for `ExtendedNominalRequest` and assumes that
extension binding has already run. This avoids needing to fake the
dependency relationship in the DeclChecker.
2025-09-09 23:18:52 +01:00
Hamish Knight
d9d0b2e6a3 [Sema] Make extension binding lazy for SourceLoader
This will mainly be useful once extension binding is fully
requestified, but even now it's a good idea to ensure module loading
isn't kicking name lookup.
2025-09-09 23:18:52 +01:00
Chris McGee
1380a3e2a9 Merge pull request #83044 from cmcgee1024/add_more_symbol_graph_opts_swiftc
Add pretty print and skip synthesized members to the frontend options
2025-09-09 15:24:27 -04:00
John McCall
c7cad4ba54 Add a function for querying the isolation of an Initializer. 2025-09-09 14:26:57 -04:00
John McCall
367520cd3f Fix two bugs with the isolation of defer bodies.
The first bug is that we weren't computing isolation correctly for
nested defers. This is an unlikely pattern of code, but it's good to fix.

The second bug is that getActorIsolationOfContext was looking through
defers, but getActorIsolation itself was not. This was causing defer
bodies to be emitted in SILGen without an isolation parameter, which
meant that #isolation could not possibly provide the right value. Fixing
this involves teaching SILGen that non-async functions can have
nonisolated(nonsending) isolation, but that's relatively straightforward.

This commit doesn't fix #isolation or adequately test SILGen, but that'll
be handled in a follow-up.
2025-09-09 14:26:57 -04:00
John McCall
74496ea86d Fix SILGen's computation of default argument generator isolation 2025-09-09 14:26:57 -04:00
Doug Gregor
e83403c2eb Merge pull request #84161 from DougGregor/remove-mergeable-symbols 2025-09-09 07:09:29 -07:00
Charles Zablit
e68b19fa28 [demangling] make printRoot virtual 2025-09-09 14:46:36 +01:00
Hamish Knight
dc13b1f442 [AST] Tail-allocate case body variables on CaseStmt 2025-09-09 13:48:40 +01:00
Hamish Knight
c02c69a783 [AST] Introduce CaseStmt::createImplicit
This allows us to re-use the same logic to create the case body
variables.
2025-09-09 13:48:40 +01:00
Hamish Knight
84befd43ab [AST] Make case body variables for CaseStmt non-optional
We don't really care about the distinction between empty and nil here.
2025-09-09 13:48:40 +01:00
Hamish Knight
3e97d729e8 [AST] Turn CaseBodyVariables into an ArrayRef
We don't need to store a `MutableArrayRef`.
2025-09-09 13:48:40 +01:00
Allan Shortlidge
dcf054197c Merge pull request #84160 from tshortli/member-import-visibility-key-paths-downgrade-to-warning
Sema: Downgrade missing import diagnostics for key paths
2025-09-08 21:59:50 -07:00
Doug Gregor
66a730b638 [Embedded] Remove -mergeable-symbols
This option is no longer necessary, because we emit weak definitions
for any imported modules. Fixes rdar://158364032.
2025-09-08 17:44:51 -07:00
Doug Gregor
74e85c8416 [SIL] Track the parent module of a SIL global variable through serialization
As with SIL functions, track the parent module where a SIL global
variable was originally defined so that we can determine whether we
are outside of its original module for linkage purposes. Use this to
make sure we emit via a weak definition when emitting to a module
other than the originating module.

Fixes rdar://160153163.
2025-09-08 17:44:49 -07:00
Allan Shortlidge
0c5eac5c3e Sema: Downgrade missing import diagnostics for key paths.
For now, downgrade the `MemberImportVisibility` diagnostics introduced in
https://github.com/swiftlang/swift/pull/83934 to warnings.

Resolves rdar://160146503.
2025-09-08 16:15:49 -07:00
Henrik G. Olsson
33a059f689 Merge pull request #84136 from hnrklssn/print-lifetime-arg-backticks
[ASTPrinter] Escape @_lifetime arguments when needed

Printing a LifetimeDescriptor would never wrap it in backticks (even if originally wrapped in backticks). This would result in the output not being able to be parsed

rdar://159992995
2025-09-08 15:29:16 -07:00
Chris McGee
b8ab5d548d Set driver options for frontend too and propagate them in compiler invocation 2025-09-08 16:41:11 -04:00
Richard Howell
986afef3a5 Merge pull request #84132 from rmaz/jsonerr
Add error messages for Swift module map parser
2025-09-08 06:42:14 -07:00
Hamish Knight
4d1a04b856 [CS] Remove AllowUnresolvedTypeVariables (#84146)
This has been unused for a while now.
2025-09-07 18:36:01 +01:00
Hamish Knight
23560df5f4 [CS] Remove AllowUnresolvedTypeVariables
This has been unused for a while now.
2025-09-07 12:17:18 +01:00
Hamish Knight
cac98f3a18 Merge pull request #84142 from hamishknight/for-none
[CS] NFC: Remove `CTP_ForEachStmt`
2025-09-06 22:43:28 +01:00
John McCall
92352b817d Merge pull request #84130 from rjmccall/nominal-type-visitor
[NFC] Introduce a convenience specialization of CanTypeVisitor
2025-09-06 13:59:33 -04:00
Henrik G. Olsson
fe14d5d636 [ASTPrinter] Move LifetimeDescriptor::getString and add test (NFC)
This refactor and test case are preparations for the implementation in
the next commit.
2025-09-05 23:03:26 -07:00
Hamish Knight
71d825dcb8 [CS] NFC: Remove CTP_ForEachStmt 2025-09-05 22:20:28 +01:00
Richard Howell
0b829bfab1 Add error messages for Swift module map parser
Parser errors with large Swift module map files can be hard to diagnose.
Refactor the parser to return an llvm::Error so clearer diagnostics can
be passed to the user.
2025-09-05 13:53:26 -07:00
John McCall
64d020ec45 [NFC] Introduce a convenience specialization of CanTypeVisitor that
forwards the paired nominal type methods to common implementations.
2025-09-05 14:02:36 -04:00
Saleem Abdulrasool
e7992a6b6b SwiftRemoteMirror: export symbols from the library on Windows
When building a shared library on Windows, ensure that we export the
symbols. We would previously export none of the interfaces making the
dynamic library unusable. Simplify the macros as
`swiftRemoteMirror_EXPORTS` would only be defined when building a shared
library.
2025-09-05 08:19:20 -07:00
Slava Pestov
aa3a0756f4 Merge pull request #84115 from slavapestov/remove-covariant-result-type
Remove TypeBase::replaceCovariantResultType()
2025-09-05 07:40:34 -04:00
Konrad Malawski
dd9dc0936b [Distributed] We're currently not using this isDistributedThunk func 2025-09-05 08:26:23 +09:00
Andrew Trick
592642087f Merge pull request #84010 from atrick/lifedep-mutating-default
@_lifetime defaults
2025-09-04 15:44:46 -07:00
Slava Pestov
cb2c0b122d AST: Remove TypeBase::replaceCovariantResultType() 2025-09-04 17:25:08 -04:00
Arnold Schwaighofer
6da200f047 Merge pull request #84009 from aschwaighofer/assembly_vision_all_the_things
Add a flag to annotate all functions with the `optremark` (`@_assemblyVision`) attribute
2025-09-04 08:57:44 -07:00
Doug Gregor
ba2af97a91 Merge pull request #84095 from DougGregor/embedded-deferred-codegen 2025-09-04 06:05:39 -07:00
eeckstein
1dde9d46d0 Merge pull request #84071 from eeckstein/capture-propagation
Optimizer: rewrite and improve the ConstantCapturePropagation pass
2025-09-04 14:05:41 +02:00
Ahmed Elrefaey
9d1436c1c8 [IDE] [Signature Help] Add basic signature help request to SourceKit (#83378) 2025-09-04 10:09:02 +01:00
Ahmed Elrefaey
1bc96857a8 Merge pull request #82464 from a7medev/feat/full-documentation-in-code-completion
[IDE] Add full documentation to code completion result
2025-09-04 10:06:21 +01:00
Erik Eckstein
bb3b0b2859 Optimizer: remove the old CapturePropagation pass 2025-09-04 08:15:47 +02:00