Commit Graph

7859 Commits

Author SHA1 Message Date
Nate Chandler
d8710fc83d [OSSACompleteLifetime] Fix error message. 2025-08-18 08:44:10 -07:00
Pavel Yaskevich
a5649a12e5 Merge pull request #83735 from xedin/rdar-158159462
[CSOptimizer] Add support for opened existential arguments
2025-08-18 00:16:24 -07:00
Hamish Knight
45065f3069 [Diags] Allow multiple in-flight diagnostics
Lift the limitation of a single active diagnostic, which was a pretty
easy-to-hit footgun. We now maintain an array of active in-flight
diagnostics, which gets flushed once all them have ended.
2025-08-17 11:48:21 +01:00
Hamish Knight
89787e24b6 Merge pull request #83766 from hamishknight/fifty-thousand-ants
[CS] Use apply component locator for `verifyThatArgumentIsHashable`
2025-08-16 05:20:51 +01:00
nate-chandler
4becc5dd15 Merge pull request #83756 from nate-chandler/assert/20250815/1
[OSSACompleteLifetime] Promote assertion.
2025-08-15 19:34:46 -07:00
Hamish Knight
4423399fce [CS] Use apply component locator for verifyThatArgumentIsHashable
For a method key path use the locator for the apply itself rather
than the member, ensuring we handle invalid cases where the apply is
the first component, and providing more accurate location info.
2025-08-15 21:30:22 +01:00
Nate Chandler
0a6c712195 [OSSACompleteLifetime] Flag disables leak checking
The utility effectively determines whether a value leaks as part of its
work, a subset of the checking done by the ownership verifier.  Disable
that checking when the flag that disables the ownership verifier is
passed.
2025-08-15 11:06:18 -07:00
Hamish Knight
8d80454591 [test] Record whether a crasher is a stack overflow 2025-08-15 17:09:58 +01:00
Nate Chandler
c197ca107e [OSSACompleteLifetime] Promote assertion.
Use llvm::report_fatal_error instead.  Also, add logging to clarify that
reaching this point is a bug in the incoming SIL.
2025-08-15 09:09:04 -07:00
Pavel Yaskevich
0d33af78ca [CSOptimizer] Add support for opened existential arguments
Check whether it would be possible to match a parameter type
by opening an existential type of the candidate argument.

Resolves: rdar://158159462
2025-08-15 00:14:51 -07:00
Hamish Knight
5e27e83456 Merge pull request #83613 from hamishknight/next-step
[IDE] Perform extension binding after AST mutation
2025-08-13 22:37:56 +01:00
Pavel Yaskevich
1060643278 Merge pull request #83687 from xedin/rdar-156955193
[TypeCheckEffects] AbstractFunction: Parameter types should be mapped…
2025-08-13 13:40:09 -07:00
nate-chandler
a868d92ad0 Merge pull request #83683 from nate-chandler/rdar158083136
[InlineArray] Fix outlining metadata collection.
2025-08-13 03:26:32 -07:00
Pavel Yaskevich
32b97d0e2a [TypeCheckEffects] AbstractFunction: Parameter types should be mapped into context
Parameter type could be represented by an associated type which is
bound to a concrete type by an extension, `AbstractFunction::getType()`
should map it into context before returning because the construct is
that it always produces a function type.

Resolves: rdar://156955193
2025-08-12 17:29:07 -07:00
Nate Chandler
3078e95074 [InlineArray] Fix outlining metadata collection.
The metadata of the element type is required for outlining.

rdar://158083136
2025-08-12 14:22:50 -07:00
Hamish Knight
ead2c0c43a Merge pull request #83634 from hamishknight/invalid-check 2025-08-12 09:36:22 +01:00
Karoy Lorentey
14b9b80746 Merge pull request #83314 from lorentey/pushing-word-boundaries
[stdlib] Fix implementation of Unicode text segmentation for word boundaries
2025-08-11 11:28:39 -07:00
Hamish Knight
e7098a34b2 [Sema] Remove isInvalid checks from checkAndContextualizePatternBindingInit
The invalid bit on PatternBindingDecl is very coarse grained, it
means any of the possible binding entries could be invalid.
Contextualization can handle invalid code anyway (e.g this is what we
do for `typeCheckBody`), so let's just avoid checking.
2025-08-11 12:55:36 +01:00
finagolfin
e251aea113 [build] Change Foundation macro checks because of #83422 (#83629)
I missed that `build-script` passes back `false` instead, so use the
`true_false` function for broader checking.
2025-08-10 18:29:24 -07:00
Hamish Knight
acf6375d46 Introduce BindExtensionsForIDEInspectionRequest
This allows us to lazily bind extensions after mutating the AST,
ensuring we don't prematurely kick the building of lookup tables.
2025-08-10 23:49:03 +01:00
finagolfin
4a3ef140d8 [build] Make the new --cross-compile-build-swift-tools flag public (#83422)
This new flag makes it easy to build Swift cross-compilation toolchains,
by disabling cross-compilation of all host tools, like the Swift
compiler and various macros, building on prior pulls #38441 and #82163.

Native compilation has more fine-grained flags like
`--build-swift-tools`, `--build-llvm`, and `--swift-testing-macros`, but
those will disable building them for _all_ platforms (with the exception
of `--build-swift-tools`, which I modified to only apply for the host,
since the initial introduction of this
`--cross-compile-build-swift-tools` flag a couple months ago), so
they're not suited for building a cross-compilation toolchain, where you
want all host tools built for the native host but not for any
cross-compilation SDKs.
2025-08-09 13:51:11 +05:30
Karoy Lorentey
847df728fc [test] Resolve failures detected by CI 2025-08-08 14:01:09 -07:00
Allan Shortlidge
5e246174a9 Merge pull request #83607 from tshortli/allow-obsolete-in-unavailable-contexts
Sema: Rationalize availability checking in unavailable contexts
2025-08-08 13:00:10 -07:00
Allan Shortlidge
4d41db3b5d Sema: Rationalize availability checking in unavailable contexts.
Correct several behaviors of availability checking in unavailable contexts that
were inconsistent with the checking model:

- Avoid diagnosing unintroduced and obsolted declarations in contexts that are
  unavailable in the same domain.
- Diagnose unavailability normally in type signature contexts.
2025-08-08 07:57:44 -07:00
Hamish Knight
5755fb293f Merge pull request #83585 from hamishknight/ext-info
Avoid dropping ExtInfo in `replaceParamErrorTypeByPlaceholder`
2025-08-08 09:53:12 +01:00
Evan Wilde
95dfa3d818 Merge pull request #83579 from etcwilde/ewilde/test-use-module-triple
Tests: Use variant module triple
2025-08-07 10:20:09 -07:00
Hamish Knight
0bd1ff0572 Avoid dropping ExtInfo in replaceParamErrorTypeByPlaceholder
Make sure we preserve the info to avoid hitting an assert.
2025-08-07 12:17:03 +01:00
Anthony Latsis
7acd1043b6 Merge pull request #83577 from swiftlang/jepa-main
[test] Pass cmake location to build-script invocation in test
2025-08-07 09:43:08 +01:00
Evan Wilde
1f06214ce6 Tests: Use variant module triple
This switches from using lit.cfg to attempt to recompute the module
triple to using the triple computed in CMake to ensure consistency.
This is a better source of truth than having many sources everywhere.

In case anyone sees this and is wondering, the "target triple" refers to
the triple that the compiler is built for, while the "variant triple"
refers to the platform that the tests and runtimes are built for.
2025-08-06 18:06:34 -07:00
Anthony Latsis
54322b22d5 [test] Pass cmake location to build-script invocation in test
The test fails without it with Xcode 26 beta
2025-08-07 00:09:10 +01:00
Allan Shortlidge
cadae7db97 Merge pull request #83570 from xedin/make-simd-perf-test-less-flaky
[TypeCHecker] Tests/NFC: Restrict SIMD performance test to macOS only
2025-08-06 14:13:31 -07:00
Evan Wilde
8a06a01577 FreeBSD: XFAIL cmark_crosscompiling_using_toolchain
FreeBSD isn't using toolchain files at the moment so this test is
failing. XFAIL'ing it on FreeBSD. If/when we do switch, the XFAIL should
fail, and we can re-enable it then.
2025-08-06 09:56:56 -07:00
Pavel Yaskevich
3d6ed73429 [TypeCHecker] Tests/NFC: Restrict SIMD performance test to macOS only
The test is flaky in some simulator and x86_64 configurations, let's
try to restrict it even further to minimize CI impact.

Resolves: rdar://157636003
2025-08-06 09:33:18 -07:00
Karoy Lorentey
3e18a07187 [stdlib] Fix implementation of Unicode text segmentation for word boundaries
Carefully overhaul our word breaking implementation to follow the recommendations of Unicode Annex #29. Start exposing the core primitives (as well as `String`-level interfaces), so that folks can prototype proper API for these concepts.

- Fix `_wordIndex(after:)` to always advance forward. It now requires its input index to be on a word boundary. Remove the `@_spi` attribute, exposing it as a (hidden, but) public entry point.
- The old SPIs `_wordIndex(before:)` and `_nearestWordIndex(atOrBelow:)` were irredemably broken; follow the Unicode recommendation for implementing random-access text segmentation and replace them both with a new public `_wordIndex(somewhereAtOrBefore:)` entry pont.
- Expose handcrafted low-level state machines for detecting word boundaries (_WordRecognizer`, `_RandomAccessWordRecognizer`), following the design of `_CharacterRecognizer`.
- Add tests to reliably validate that the two state machine flavors always produce consistent results.

rdar://155482680
2025-08-05 20:04:46 -07:00
Hamish Knight
3db1a66f08 Merge pull request #83514 from hamishknight/add-assert-msgs
[test] Add assertion messages to crasher test cases
2025-08-04 23:05:32 +01:00
Pavel Yaskevich
7d75f712b6 Merge pull request #83511 from xedin/rdar-152553143
[CSSyntacticElement] Remove an assert that is too strict
2025-08-04 14:09:09 -07:00
Hamish Knight
760959f273 [test] Add assertion messages to crasher test cases
If the crasher hits an assertion failure, include the message in the
header.
2025-08-04 13:00:23 +01:00
Pavel Yaskevich
3879a47b52 [CSSyntacticElement] Remove an assert that is too strict
`return` statement withot an expression automatically gets an
implicit `()` which is allowed to be converted to types like
`()?` and `Any` or `Any?`. Let's remove a too strict assertion
that expected a contextual type to always be `()?` even
through in reality any type that `()` is convertible to is valid.

Resolves: rdar://152553143
2025-08-04 00:17:26 -07:00
Hamish Knight
cfa8135261 [test] Add some more known crashers 2025-08-04 00:44:41 +01:00
Hamish Knight
3d6c240aa6 Merge pull request #83504 from hamishknight/update-sigs
[test] Update some crasher signatures
2025-08-02 22:48:02 +01:00
Hamish Knight
a012464566 [test] Update some crasher signatures 2025-08-02 17:35:53 +01:00
finagolfin
09a751f698 [build][android] Use a CMake toolchain file to cross-compile Testing (#83260)
Also, disable a recently failing test for Android armv7 and enable another one
that now passes.
2025-08-02 15:27:45 +05:30
Hamish Knight
fb7f2d0ff2 [CS] Limit the number of chained @dynamicMemberLookup lookups
Set an upper bound on the number of chained lookups we attempt to
avoid spinning while trying to recursively apply the same dynamic
member lookup to itself.

rdar://157288911
2025-08-01 19:08:04 +01:00
Hamish Knight
aac9c4dec6 [test] Add timeout for fd52bd37cd5c96.swift
Make sure we either crash or timeout after a minute.
2025-07-30 15:13:50 +01:00
Hamish Knight
ae0f9f51d8 [test] Add some more known crashers 2025-07-28 11:14:13 +01:00
Hamish Knight
74601b5e58 [test] Remove duplicate test case
This is essentially the same as `4414db6acd8120aa.swift`.
2025-07-28 11:14:13 +01:00
Hamish Knight
d7c30cd965 [test] Update a couple of crasher signatures 2025-07-28 11:14:13 +01:00
Slava Pestov
5866d8a36a Sema: Fix crash with invalid reference to macro 2025-07-24 12:55:47 -04:00
Pavel Yaskevich
3b06d87e90 Merge pull request #83179 from xedin/rdar-128109889
[ASTVerifier] Allow `inout` and `Array` to pointer conversion in vari…
2025-07-23 07:48:58 -07:00
Pavel Yaskevich
24210cf2d4 Merge pull request #83210 from xedin/rdar-143586718
[Concurrency] InferSendableFromCaptures: Rework check to delay lookup
2025-07-23 00:23:18 -07:00