Commit Graph

8015 Commits

Author SHA1 Message Date
Hamish Knight
e2287b6312 Merge pull request #85449 from hamishknight/whats-the-catch
[Sema] Skip type-checking catch bodies when computing the bound error type
2025-11-12 19:34:45 +00:00
Pavel Yaskevich
4d8d719b92 Merge pull request #85406 from naveen-seth/fix-ambiguous-trailing-closure-init
[Sema] Fix crash when diagnosing ambiguous trailing closure inits
2025-11-12 10:03:46 -08:00
Hamish Knight
14608cb059 [Sema] Skip type-checking catch bodies when computing the bound error type
Make sure we only ever type-check the `do` body of a `do-catch`
statement when lazily type-checking the bound error type, which we can
do for completion.

rdar://164481242
2025-11-11 23:04:30 +00:00
naveen-seth
a20879b7cc Move new test to validation-test/compiler_crashers 2025-11-11 17:24:37 +01:00
naveen-seth
d07ea18b55 Mark validation test as fixed 2025-11-11 00:43:01 +01:00
Hamish Knight
1b5e1db05d [test] Add some more known crashers 2025-11-10 10:40:35 +00:00
Hamish Knight
0c553cabee [test] Add some not-yet-crashing crashers
These would crash with an assertion I'm planning on adding, make sure
I fix them before adding the assert.
2025-11-10 10:40:35 +00:00
Hamish Knight
ebd97bb3a0 [test] Update a couple of crasher signatures 2025-11-10 10:40:35 +00:00
Hamish Knight
fe54011bcb Merge pull request #85393 from hamishknight/add-null-check
[CS] Add null check for ParameterList in `findFavoredChoicesBasedOnArity`
2025-11-08 03:44:10 +00:00
Hamish Knight
b26b0b783e [CS] Add null check for ParameterList in findFavoredChoicesBasedOnArity
rdar://164116965
2025-11-07 22:17:33 +00:00
Hamish Knight
0feacec63b [CS] Fix an over-eager assert
We can in fact have placeholders here if the type is bound to a hole.
2025-11-07 16:23:30 +00:00
Hamish Knight
f205f469a9 [CS] Replace error type with hole for projected value
Missed this in my previous patch, make sure we replace an error with
a hole if necessary.
2025-11-05 20:29:15 +00:00
Hamish Knight
dad263728f Merge pull request #85193 from hamishknight/wrapping-paper
[CS] A couple of property wrapper fixes
2025-11-05 19:51:51 +00:00
Hamish Knight
0f58eb2104 [Sema] Fix and cleanup distributed id/actorSystem synthesis (#85245) 2025-11-04 10:17:05 +09:00
Hamish Knight
260d10f6b8 [CS] Fix a couple of fixPropertyWrapperFailure crashers
Make sure we query the constraint system for a type if we have a local
property wrapper in a closure to avoid kicking interface type
computation outside the closure, and make sure we map into context if
we need to.
2025-11-04 00:56:01 +00:00
Hamish Knight
c1bf9f4fb1 [CS] Invalidate auxiliary vars in markInvalid
And make sure we mark any PatternBindingDecl entries as having
been checked to avoid re-checking. This fixes a crash where we could
attempt to re-check a property wrapper to compute its backing type.
2025-11-04 00:56:00 +00:00
Hamish Knight
e0de61caa4 Merge pull request #85135 from hamishknight/lazy-fix
[AST] Avoid exposing `lazy` local storage var to name lookup
2025-11-04 00:53:31 +00:00
Kathy Gray
feebe6aa49 Merge pull request #85235 from kathygray-pl/requirementMachine: Fix crash on pack
Requirement Machine: Fix crash on pack + tuple type
2025-11-03 13:49:34 +00:00
Anthony Latsis
b0548203e2 [test] Clean up a few more nocapture in tests 2025-11-02 08:28:54 +00:00
Kathy Gray
d68a7a7ef0 Requirement Machine: Fix an issue with pack expansion + tuple type crashes
Support pack expansion types in term rewriting, maintaining shape invariants and not
throwing assertions unnecessarily.

Additional tests added for an inifinite case and a concrete case.
2025-10-31 17:53:59 +00:00
Slava Pestov
2ba29d3806 Merge pull request #85183 from slavapestov/fix-issue-85034
Sema: Don't coerce subexpression of 'try' to rvalue
2025-10-29 07:20:27 -04:00
Slava Pestov
8fd7a1db86 Sema: Fix CSGen for ForceTryExpr 2025-10-28 19:56:32 -04:00
Slava Pestov
f014a9aeec Sema: Don't coerce subexpression of 'try' to rvalue
The change in 8ab8b2e3e9, was too
broad. We want to coerce the subexpression of `try!` to an rvalue,
but not the subexpression of a `try`.

If the subexpression of a `try` becomes an rvalue even though the
type of the parent expression is an lvalue, we can end up with
infinite recursion in coerceToType(), as demonstrated by the
test case.

Fixes https://github.com/swiftlang/swift/issues/85034.
2025-10-28 19:21:35 -04:00
Slava Pestov
97f7efd257 Sema: rdar://r78102266 was a SILGen crash so fix the test to pass -emit-silgen 2025-10-28 19:21:01 -04:00
Hamish Knight
949bb3db9b Merge pull request #85173 from hamishknight/no-asan
[test] Avoid running crasher test cases on ASan
2025-10-28 21:28:00 +00:00
Konrad `ktoso` Malawski
fc168a0773 [Distributed] Don't crash when 'open' distributed actor is declared (#85170) 2025-10-28 23:30:06 +09:00
Hamish Knight
29e1fddaa9 [test] Avoid running crasher test cases on ASan 2025-10-28 11:34:19 +00:00
Pavel Yaskevich
ca0491ac77 Merge pull request #85151 from xedin/rdar-161419917
[CSOptimizer] Update unary call favoring to include resolved member r…
2025-10-28 18:06:00 +09:00
Hamish Knight
41acdebce4 Merge pull request #85150 from hamishknight/fuzzy
[test] Add some more known crashers
2025-10-27 17:51:25 +00:00
Hamish Knight
b47ab91547 Merge pull request #85149 from hamishknight/fail-n-bail
[CS] Propagate CSApply failures in a few more places
2025-10-27 16:58:03 +00:00
Pavel Yaskevich
e1a6077117 [CSOptimizer] Update unary call favoring to include resolved member references
Update special favoring logic for unlabeled unary calls to support
non-overloads member references in argument positions.

The original hack missed a case where a type of a member is known
in advance (i.e. a property without overloads) because there as
another hack (shrink) for that.

This helps in situations like `Double(x)` where `x` is a property
of some type that is referenced using an implicit `self.` injected
by the compiler.

Resolves: rdar://161419917
2025-10-27 18:22:37 +09:00
Hamish Knight
88091da974 [test] Add some more known crashers 2025-10-27 08:49:51 +00:00
Hamish Knight
f67c54d24c [test] Update a couple of crasher signatures 2025-10-27 08:49:51 +00:00
Hamish Knight
05e3d15955 [CS] Propagate CSApply failures in a few more places
We had some cases where we weren't propagating failures to apply the
solution, and as such weren't invalidating the resulting AST. Fix up
these cases.
2025-10-26 14:49:17 +00:00
Hamish Knight
62f0926d25 [CS] Invalidate nested unresolved VarDecls when ignoring completion argument
Make sure we set types for any nested VarDecls in UnresolvedPatternExprs
to ensure we don't crash when attempting to solve the body.
2025-10-26 12:33:29 +00:00
Hamish Knight
55ebd0774e [AST] Avoid exposing lazy local storage var to name lookup
We already reject attempts to reference this for `lazy` properties.
For `lazy` locals let's just not expose it to name lookup to begin
with. This ensures we don't attempt to prematurely kick the interface
type computation for the var, fixing a couple of crashers.
2025-10-25 15:07:11 +01:00
nate-chandler
b4777083b0 Merge pull request #85128 from nate-chandler/rdar162922634
[CastOptimizer] Use TypeConverter to lower type.
2025-10-24 23:47:03 -07:00
Slava Pestov
3b1960eb9a Merge pull request #85016 from slavapestov/prepared-fuzz
Sema: Fix a fuzzer crash
2025-10-24 21:46:34 -04:00
Nate Chandler
ef6bd64e7f [CastOptimizer] Use TypeConverter to lower type.
rdar://162922634
2025-10-24 15:34:09 -07:00
Slava Pestov
69c8d15570 Sema: Fix a fuzzer crash
This test case crashes when prepared overloads are disabled, but passes
when enabled. To avoid messing up tests if we have to turn the flag on
and off, fix the crash.
2025-10-24 16:20:21 -04:00
Hamish Knight
8306112aec [AST] Fix crash in PrintAST::printAccessors
Make sure we check whether `accessorsToPrint` is empty.
2025-10-24 13:08:26 +01:00
Hamish Knight
7f6a4da04e Merge pull request #85062 from hamishknight/not-the-bees 2025-10-23 22:39:58 +01:00
Hamish Knight
c7e9809480 [IDE] Mangle USRs using API decls rather than ABI decls
For semantic functionality the API decl is the more useful thing to
mangle, and redeclaration checking ensures we can't end up with
conflicts. This ensures we're able to perform a name lookup for the
decl based on its USR without having to maintain a separate lookup 
table for ABI names.
2025-10-23 09:11:17 +01:00
Slava Pestov
dfd16a0ea2 Merge pull request #85070 from slavapestov/three-regression-tests
Add regression tests for fixed crashers
2025-10-22 21:14:56 -04:00
Slava Pestov
4998cd6d17 Add regression tests for fixed crashers 2025-10-22 15:47:35 -04:00
Hamish Knight
5ea66e695d Merge pull request #84999 from hamishknight/add-fixed-crasher
[test] Add a fixed crasher
2025-10-21 20:41:48 +01:00
Hamish Knight
0eb83fea8b [test] Add some more known crashers 2025-10-20 10:14:32 +01:00
Hamish Knight
eb9ae7c2ef [test] Update a couple of crasher signatures 2025-10-20 10:14:32 +01:00
Hamish Knight
997ad0cd53 [test] Add a fixed crasher 2025-10-19 13:12:14 +01:00
Hamish Knight
4e811c3a88 [test] Merge crasher directories
There is no longer much of a good reason to keep these separate,
merge them.
2025-10-18 12:51:30 +01:00