Pavel Yaskevich
d6019ac466
Merge pull request #65366 from xedin/issue-65360
...
[CSSolver] Fix a crash in diagnostics related to pattern matching
2023-04-24 16:27:25 -07:00
nate-chandler
0c0ec72255
Merge pull request #65377 from nate-chandler/rdar108385761
...
[SILGen] Consuming a param implies it's eager-move.
2023-04-24 12:49:46 -07:00
Pavel Yaskevich
20d7642ca4
[CSGen] Allow expression pattern types to be holes
2023-04-24 10:02:00 -07:00
Nate Chandler
525541fd1c
[Sema] Ban @_eagerMove on Copyable things.
2023-04-21 21:59:31 -07:00
Pavel Yaskevich
8a26df8166
[ConstraintSystem] NFC: Standardize the way of type holefication
...
Introduce `ConstraintSystem::recordTypeVariablesAsHoles` as a
standard way to record that unbound type variables found in a
type are holes in the given constraint system.
2023-04-21 15:22:13 -07:00
Pavel Yaskevich
b081bdbf57
[CSGen] Allow is pattern types to be holes
2023-04-21 12:14:41 -07:00
Pavel Yaskevich
70eeccb3cc
[CSSimplify] Fix attempt to rebind type variables in sequence element pattern
2023-04-21 11:45:20 -07:00
Doug Gregor
ae4a5ded8f
[Macros] Improve parsing, representation, and serialization of role attributes
...
Parse compound and special names in the macro role attributes
(`@freestanding` and `@attached`). This allows both compound names and
initializers, e.g., `init(coding:)`.
Fixes rdar://107967344.
2023-04-21 11:36:06 -07:00
Pavel Yaskevich
1c3667b52a
Merge pull request #65310 from calda/cal--SE-3065-bad-pattern-check
...
[SE-0365] Fix issue where boolean condition before `let self` condition would prevent using implicit self
2023-04-21 09:54:27 -07:00
Alex Lorenz
346ba0153a
Merge pull request #65338 from hyp/eng/enum-fix-indirect
...
[interop][SwiftToCxx] do not expose unsupported enums yet
2023-04-21 08:15:42 -07:00
Hamish Knight
017794a7d7
Merge pull request #65098 from hamishknight/poundland
2023-04-21 09:26:10 +01:00
Alex Lorenz
71ef7e8d3d
[interop][SwiftToCxx] do not expose unsupported enums yet
...
This includes indirect enums, enums with multiple associated values, or enums whose associated value is a type we don't yet support
2023-04-20 18:05:00 -07:00
Anthony Latsis
d224efc8a8
Merge pull request #65318 from AnthonyLatsis/revert-f608802cfe498b8684e4ea63603fe99073102ce6
...
Revert "Sema: Emit diagnostics when walking into collection literals with defaulted types"
2023-04-21 01:26:03 +03:00
Cal Stephens
ee906f7ba5
Merge branch 'main' into cal--SE-3065-bad-pattern-check
2023-04-20 13:41:48 -07:00
Cal Stephens
870dbccf88
Consolidate LabeledConditionalStmt::rebindsSelf logic into shared helper
2023-04-20 13:39:05 -07:00
Anthony Latsis
f76f6acbf0
Revert "Sema: Emit diagnostics when walking into collection literals with defaulted types"
...
This reverts commit f608802cfe .
2023-04-20 21:55:40 +03:00
Cal Stephens
3e140286e8
Fix issue where non-pattern-binding condition would break SE-0365 unwrapped self check
2023-04-19 19:17:35 -07:00
Rintaro Ishizaki
8dcca5809f
Merge pull request #65263 from rintaro/nullterminatedstringref-rdar108215490
...
[Basic] Ensure empty NullTerminatedStringRef have valid pointer
2023-04-19 15:22:47 -07:00
Slava Pestov
f1b8d9d111
Merge pull request #65278 from slavapestov/astprinter-pack-requirement
...
ASTPrinter: Fix printing of pack requirements
2023-04-19 16:14:40 -04:00
Angela Laar
a473281b43
Merge pull request #64520 from angela-laar/duplicate-raw-value-crash
...
[Sema] Compiler should diagnose non-unique raw values without crashing
2023-04-19 12:34:47 -07:00
Rintaro Ishizaki
a0eb32e4d7
[Macros] Create llvm::MemoryBuffer directly from macro expansion result
...
Saves one memory copy. No need to create a temporary
NullTerminatedStringRef.
2023-04-19 10:50:56 -07: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
Artem Chikin
a5017db87a
Merge pull request #65234 from artemcm/TestableDependencyOptionalLookup
...
[Dependency Scanning] Consider optional dependencies of `@testable` textual dependencies with an adjacent binary module
2023-04-19 08:41:45 -07:00
Anthony Latsis
0028322485
Merge pull request #65246 from AnthonyLatsis/nfc-debug-constraints
...
[NFC] CS: Misc minor debug output tweaks
2023-04-19 02:46:05 +03:00
Doug Gregor
8b76522038
Merge pull request #65253 from DougGregor/objc-impl-async-completion-handler-matching
...
Handle async vs. completion-handler mismatches in `@_objcImplementation`.
2023-04-18 13:01:11 -07:00
Anthony Latsis
82ac9328ae
[NFC] CS: Misc minor debug output tweaks
...
* Use fancy arrows (`→`) because they are distinct from and shorter than `->`,
and fancier.
* We have two ways of demarcating locators: `@ <locator>` and `[[<locator>]];`.
Stick to the first, which is shorter and clearer.
* 'attempting type variable' → 'attempting binding'. *Bindings* are attempted,
not type variables.
* `considering ->` → `considering:`. I think a colon is semantically more fit
and makes things easier to read if the considered constraint has arrows in its
description or types. It’s also shorter this way.
2023-04-18 22:42:59 +03:00
Doug Gregor
79e26970ba
Handle async vs. completion-handler mismatches in @_objcImplementation.
...
Fixes rdar://108160837.
2023-04-18 08:52:20 -07:00
Artem Chikin
6fcd8be072
[Dependency Scanning] Pull optional dependencies from the adjacent binary module for direct interface dependencies
...
For a `@Testable` import in program source, if a Swift interface dependency is discovered, and has an adjacent binary `.swiftmodule`, open up the module, and pull in its optional dependencies. If an optional dependency cannot be resolved on the filesystem, fail silently without raising a diagnostic.
2023-04-17 14:47:46 -07:00
Joe Groff
8ea5ab84d3
Merge pull request #65173 from jckarter/noncopyable-tuples-not-supported
...
Diagnose attempts to use tuples with noncopyable elements.
2023-04-17 10:49:53 -07:00
Doug Gregor
9436899526
Merge pull request #65219 from DougGregor/reference-cycle-visible-name-lookup
2023-04-17 08:05:58 -04:00
Doug Gregor
ab682f1658
[Macros] Break reference cycles involving visible name lookup
2023-04-16 13:31:42 -04:00
Holly Borla
0ed4b3325f
[SE-0393] Enable parameter packs for generic functions.
...
The VariadicGenerics flag still exists and is required for generic types
with parameter packs
2023-04-15 15:40:05 -07:00
Joe Groff
52e97d6544
Diagnose attempts to use tuples with noncopyable elements.
...
These aren't fully supported yet. rdar://108024586
2023-04-14 16:49:30 -07:00
Dave Lee
39bb7bfe44
[AST] Convert ASTContext::getSwiftName to a free function
...
The only state `getSwiftName` uses is its argument, and can be made a free function. Of
note the inverse operation, `getKnownFoundationEntity`, is also a free function. This
removes the requirement that callers have an `ASTContext` instance.
(cherry-picked from commit fb524c0b86 )
2023-04-14 11:43:13 -06:00
Pavel Yaskevich
f13e1319d5
Merge pull request #65165 from xedin/record-pack-expansion-envs
...
[CSSolver] Add recorded pack expansion environments to solutions
2023-04-14 09:44:54 -07:00
Anthony Latsis
8f2f9d94af
Merge pull request #65132 from AnthonyLatsis/fukamushicha
...
[NFC] ExistentialRequiresAnyRequest → HasSelfOrAssociatedTypeRequirementsRequest
2023-04-13 22:22:28 +03:00
Alex Lorenz
045fcf3ff5
[interop] Prohibit use of C++ APIs in public interfaces that opt-in into library evolution
...
The CxxStdlib overlay now has to be built without library evolution enabled.
2023-04-13 10:48:09 -07: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
39c9ae2fc6
[NFC] ExistentialRequiresAnyRequest → HasSelfOrAssociatedTypeRequirementsRequest
...
The current name is misleading because it suggests that the request accounts
for language feature state, which it does not (and is not supposed to).
2023-04-13 07:50:06 +03:00
Anthony Latsis
8d1d526195
TypeCheckType: Fix existential 'any' migration diagnostics for extra-modular protocols
2023-04-13 03:37:25 +03:00
Pavel Yaskevich
fdca26588e
[CSSolver] Add recorded pack expansion environments to solutions
...
Fixes a bug where only pack environments created during constraint
would be usable during solution application, everything else would
create a new environment that would produce pack elements with new
UUIDs which cases issues during SILGen.
2023-04-12 14:14:15 -07:00
Ellie Shin
9680734250
Merge pull request #65109 from apple/es-fix
...
Add a target nil check
2023-04-12 13:59:51 -07:00
Pavel Yaskevich
6c9bd8d7a5
Merge pull request #65071 from xedin/rdar-107835060-followup
...
[CSSyntaticElement] Canonicalize type before collecting "in scope" va…
2023-04-12 12:21:19 -07:00
Ellie Shin
bb99eb08ac
Add a target nil check
...
Resolves rdar://107837804
2023-04-12 11:16:19 -07:00
Doug Gregor
2bcef82eb5
Merge pull request #65032 from DougGregor/attached-macro-mangle-without-cycles
2023-04-12 12:58:35 -04:00
Hamish Knight
3f7c3a2faf
Handle #if for if/switch expressions
...
- Allow an if/switch expression to become an
implicit return of a function that has a `#if`
body with a single active element that is an `if`
or `switch`.
- Allow `#if` branches of an if/switch expression,
as long as there is a single active expression
element.
rdar://107487977
2023-04-12 14:54:22 +01:00
Hamish Knight
bca451baa0
[Sema] Improve diagnostic for empty if expr branch
...
Previously we would say that it must end with a
`throw`, but a more useful diagnostic is that
there is an expression missing.
2023-04-12 14:54:22 +01:00
Doug Gregor
ef7970bad3
[Macros] Ensure that we compute the interface type before we add accessors
...
Adding accessors to a stored property, which removes its initializer.
Force computation of the interface type first.
There are better ways to model this in the AST, but it requires
reworking how we handle initializers to break them into requests.
2023-04-11 23:40:32 -04:00
Rintaro Ishizaki
ace080c9f3
[Macros] Make 'LoadedCompilerPlugin' a wrapper of PointerUnion
2023-04-11 14:59:23 -07:00