Commit Graph

3451 Commits

Author SHA1 Message Date
Alejandro Alonso
f4f60f4344 Remove Value requirement Add GenericTypeParamKind 2024-09-04 15:13:43 -07:00
Alejandro Alonso
75c2cbf593 Implement value generics
Some requirement machine work

Rename requirement to Value

Rename more things to Value

Fix integer checking for requirement

some docs and parser changes

Minor fixes
2024-09-04 15:13:25 -07:00
Slava Pestov
851a829063 Sema: Consolidate logic for opening existentials in OpenedExistentials.cpp 2024-09-04 14:57:38 -04:00
Doug Gregor
601a5c3c0c Merge pull request #76187 from DougGregor/extract-inlinable-text-swift-syntax
Implement extractInlinableText with swift-syntax
2024-09-04 07:53:40 -07:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00
Konrad `ktoso` Malawski
c86e4a8738 Merge pull request #60057 from nickolas-pohilets/mpokhylets/isolated-deinit
Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com>
2024-09-04 01:16:56 +09:00
Slava Pestov
cc6b3c1cba AST: Simplify ValueDecl::findExistentialSelfReferences() 2024-09-02 21:42:04 -04:00
Slava Pestov
2ebef08f7e AST: Generalize findGenericParameterReferences() 2024-09-02 21:42:04 -04:00
Slava Pestov
36683a804c AST: Handle missing cases in findGenericParameterReferencesRec() 2024-09-02 17:14:22 -04:00
Slava Pestov
56cefdc83f AST: Clean up findGenericParameterReferences() 2024-09-02 16:12:31 -04:00
Konrad `ktoso` Malawski
c55ad6fa88 Merge branch 'main' into mpokhylets/isolated-deinit 2024-09-02 23:16:17 +09:00
Slava Pestov
aa81ce3f6c AST: Use new form of getOpenedExistentialSignature() in getMinimalCanonicalType() 2024-09-01 18:03:47 -04:00
Doug Gregor
a73711ef4b Implement extractInlinableText with swift-syntax
Replace the existing C++ implementation of extractInlinableText with
a new implementation based on swift-syntax. It uses SwiftIfConfig to
remove inactive regions (with a special mode), and a new compiler-only
entrypoint in the library to remove comments and `#sourceLocation`.
2024-08-30 16:43:41 -07:00
Mykola Pokhylets
e0ad7bde82 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/AST/ASTPrinter.cpp
#	lib/AST/FeatureSet.cpp
2024-08-29 11:28:43 +02:00
Hamish Knight
1cb0f8fdd5 [AST] Rename isPrivateStdlibDecl -> isPrivateSystemDecl
This better reflects what we're actually checking
here.
2024-08-28 18:31:51 +01:00
Hamish Knight
05954eaa90 [AST] Account for non-user modules in isPrivateStdlibDecl
Consider both non-user and system modules when
checking whether an underscored decl should be
considered private.

rdar://131854240
2024-08-28 18:31:51 +01:00
Konrad `ktoso` Malawski
1861375f88 [Concurrency] Suggest adding a method, when mutating actor property cross isolation (#75922) 2024-08-22 20:24:39 +09:00
Doug Gregor
cccf6c1114 Introduce @unsafe and the ability to prohibit use of unsafe declarations
Allow any declaration to be marked with `@unsafe`, meaning that it
involves unsafe code. This also extends to C declarations marked with
the `swift_attr("unsafe")` attribute.

Under a separate experimental flag (`DisallowUnsafe`), diagnose any
attempt to use an `@unsafe` declaration or any unsafe language feature
(such as `unowned(unsafe)`, `@unchecked Sendable`). This begins to
define a "safe" mode in Swift that prohibits memory-unsafe constructs.
2024-08-19 14:33:07 -07:00
Slava Pestov
0e853a358e Merge pull request #75935 from slavapestov/remove-transform
AST: Replace remaining uses of Type::transform() with transformRec()
2024-08-17 09:11:52 -04:00
iMostfa
80a8a0746b Replace uses of the word "accessor" in diagnostics with user-facing terminology (#74462)
In this PR i worked on replacing the word accessor in diagnostics with more user-facing terminologies like setter, getter, didSet Observer, and members based on the context of the message.

in some messages i didn't need to pass DescriptiveDeclKind instead i just changed the text copy itself.

i also updated tests, so you might find it easier to check my changes this way.

Please let me know if there's something i should've done in a better way, and request changes if needed. !

i can squash my commits after reviewing getting the PR Reviewed, just to make it easier to be checked commit by commit

Resolves #55887
2024-08-16 16:29:30 -07:00
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
Ellie Shin
93f9a17c33 Merge pull request #75872 from swiftlang/elsh/pkg-switch-enum 2024-08-15 05:48:09 -07:00
elsh
4f0f774856 Rename -> isInterfacePackageEffectivelyPublic 2024-08-14 01:35:24 -07:00
Ellie Shin
fadf6ec96c [Sema] Remove @unknown default requirement for package enums.
`@unknown default` in switch statements are required for resilient enums since they
might be modified with new fields in the future and modules defining the enums are
generally not built together with the consuming modules.

However, if the modules are in the same package, they are required to be built together,
thus the requirement for `@unknown default` can be skipped. This PR removes the need for
that, enabling less boilerplate. Note this change only impacts typecheck and not SIL gen.

Resolves rdar://130015149.
2024-08-13 17:06:51 -07:00
Ellie Shin
dc1c34dfa1 [Sema] Treat @usableFromInline package decls from interface as public and skip access checks
Resolves rdar://133319906
2024-08-13 17:01:19 -07:00
Slava Pestov
b601c294ac AST: Replace remaining uses of Type::transform() with transformRec() 2024-08-12 16:05:43 -04:00
Slava Pestov
375363a473 AST: Move global conformance lookup entry points to ConformanceLookup.h 2024-08-08 23:35:58 -04:00
Holly Borla
5fa35b5c3e [Concurrency] Compute the source of actor isolation in ActorIsolationRequest. 2024-08-04 18:48:57 -07:00
Allan Shortlidge
f7ff3f0001 SILGen: Introduce macCatalyst support for @backDeployed.
Upstreams the necessary changes to compile references to `@backDeployed`
declarations correctly when a `macabi` target triple or a `-target-variant` is
specified.
2024-07-23 17:00:10 -07:00
Ellie Shin
cb776089cb Merge pull request #75154 from swiftlang/elsh/drop-exp-prefix
Drop experimental prefixes from PackageCMO flags.
2024-07-11 12:12:29 -07:00
Mykola Pokhylets
816d62c972 Merge remote-tracking branch 'upstream/main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/SILGen/SILGenDestructor.cpp
#	test/Concurrency/flow_isolation.swift
#	test/abi/macOS/arm64/concurrency.swift
#	test/abi/macOS/x86_64/concurrency.swift
2024-07-11 13:11:59 +02:00
Mykola Pokhylets
2cb7e8d7b8 Implemented suppressing isolated deinit for compatibility with older compiler versions 2024-07-11 13:09:08 +02:00
Mykola Pokhylets
95079aff06 Don't generate isolating destructor if dealloc was explicitly isolated in ObjC 2024-07-11 13:09:06 +02:00
Mykola Pokhylets
10ee94885e Generating errors when isolation of the subclass deinit is not compatible with superclass deinit 2024-07-11 13:09:05 +02:00
Ellie Shin
18681c43fb Drop experimental prefixes from PackageCMO flags.
Deprecate experimental- flags with prompts to use the proper flags.

rdar://131498517
2024-07-10 16:19:16 -07:00
Meghana Gupta
154989463b Add support for lifetime dependence in parameter position 2024-07-10 14:20:03 -07:00
Meghana Gupta
8137aed238 Rename LifetimeDependentReturnTypeRepr -> LifetimeDependentTypeRepr 2024-07-10 14:20:03 -07:00
Slava Pestov
ec28d62d61 Convert AttachedPropertyWrappersRequest to use split caching 2024-07-06 23:36:00 -04:00
Slava Pestov
80ddc3275f Convert PropertyWrapperAuxiliaryVariablesRequest to use split caching 2024-07-06 23:35:59 -04:00
Slava Pestov
86d567f95a AST: ModuleDecl::lookupConformance() is a static method 2024-07-06 12:05:47 -04:00
Slava Pestov
3fcda140bb AST: ModuleDecl::checkConformance() is a static method 2024-07-06 12:05:46 -04:00
Michael Gottesman
34195ff213 Merge pull request #74610 from gottesmm/pr-324fd70c13e87a329334341aae4667f2d1be152c
[sending] Remove transferring.
2024-07-02 14:02:18 -07:00
Kavon Farvardin
4b98498bf2 Merge pull request #74672 from kavon/post-vacation-misc-cleanups
Handful of small NoncopyableGenerics fixes / cleanups.
2024-06-25 18:35:40 -07:00
Slava Pestov
17a6a80204 AST: Use separate caching for ProtocolDecl::getAllInheritedProtocols() 2024-06-25 15:20:42 -04:00
Kavon Farvardin
80c99973d7 NFC: introduce isAddingConformanceToInvertible
Removes duplicated code between Sema and the ASTPrinter.
2024-06-24 15:34:58 -07:00
Michael Gottesman
112071e57d [sending] Remove transferring.
Out of an abundance of caution, we:

1. Left in parsing support for transferring but internally made it rely on the
internals of sending.

2. Added a warning to tell people that transferring was going to
be removed very soon.

Now that we have given people some time, remove support for parsing
transferring.

rdar://130253724
2024-06-21 16:03:21 -07:00
Ellie Shin
4207dcea17 Merge pull request #74584 from apple/elsh/pcmo-missing-change
[PackageCMO] Add back missing change for package scope in table entry…
2024-06-20 16:15:33 -07:00
Ellie Shin
45cf9ac2c6 [PackageCMO] Add back missing change for package scope in table entry visibility check
rdar://130222362
2024-06-20 12:08:54 -07:00
Tim Kientzle
1098054291 Merge branch 'main' into tbkka-assertions2 2024-06-18 17:52:00 -07:00
Slava Pestov
8582828e7a Merge pull request #74445 from slavapestov/fix-failure-type-witness
Concurrency: Fix default type witness for AsyncSequence.Failure
2024-06-17 17:09:06 -04:00