Commit Graph

784 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Slava Pestov
3b1960eb9a Merge pull request #85016 from slavapestov/prepared-fuzz
Sema: Fix a fuzzer crash
2025-10-24 21:46:34 -04: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
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
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
Meghana Gupta
827caa9fce XFAIL typechecker test which leads to a cycle in the requirement machine
This PR introduces a `mapTypeIntoContext` in `InterfaceTypeRequest::evaluate` which introduces a cycle in this test.
2024-11-12 12:05:23 -08:00
Kavon Farvardin
53fb8c3570 XFAIL test for minor issue
This test is failing to verify the generic signature for this bogus
 program, because the generic signature isn't minimal. We should
 gracefully handle this situation and still have a minimal signature,
 despite rejecting this program.
2024-03-14 23:10:44 -07:00
Slava Pestov
af8c8f1671 Sema: Remove non-experimental associated type inference 2024-03-07 17:30:17 -05:00
Slava Pestov
3662bb2a28 Remove REQUIRES: asserts from fixed crashers 2024-03-06 21:38:28 -05:00
Slava Pestov
d3aa3a8db9 Adjust XFAILs 2024-02-29 13:55:48 -05:00
Doug Gregor
c142205a50 Resolve an old compiler crasher via the new diagnostic formatter
The old diagnostic formatter would crash on some Fix-Its involving
Unicode characters. The new one does not.
2024-02-19 02:48:37 -10:00
Slava Pestov
c5c6e00d0e Pass -disable-experimental-associated-type-inference in a compiler_crasher pending further investigation 2024-01-25 22:01:44 -05:00
Holly Borla
0708e0efd4 Revert "Tests: Disable failing SwiftUI validation tests" 2022-11-15 09:10:23 -08:00
Allan Shortlidge
b2421aa463 Tests: Disable failing SwiftUI validation tests until rdar://102298208 is fixed. 2022-11-13 16:56:20 -08:00
Anthony Latsis
25e42ca56c Gardening: Migrate test suite to GH issues: validation-test/compiler_crashers_fixed 2022-09-19 22:34:06 +03:00
Nate Chandler
f454717c6e [IRGen] Look through opaque types for protocol witness table lazy access function.
When determining the linkage of protocol witness table lazy access
functions and their cache variables, look through opaque types to find
the underlying decls.

rdar://96194366
2022-07-11 15:21:38 -07:00
Anthony Latsis
7158760dbb Add fixed crasher to close #43187 2022-06-24 05:03:28 +03:00
Slava Pestov
dac8d666ee Stop passing -requirement-machine-{abstract,inferred,protocol}-signatures flags in tests
These flags are now no-ops.
2022-05-10 12:56:17 -04:00
Slava Pestov
226d2c89a0 RequirementMachine: Disable verification in a few highly-invalid compiler_crashers where it's not useful 2022-03-14 12:33:18 -04:00
Slava Pestov
a61f67a0e8 RequirementMachine: Hack to allow protocol typealiases to appear in associated type inheritance clauses
If you have something like

    protocol P {
      typealias A = C

      associatedtype T : A
    }

    class C {}

Then ::Structural resolution of 'A' in the inheritance clause will
produce a DependentMemberType 'Self.A'. Check for this case and
attempt ::Interface resolution to get the correct underlying type.

Fixes rdar://problem/90219229.
2022-03-14 12:33:18 -04:00
Holly Borla
12459cff80 [Diagnostics] Print 'any' in diagnostic arguments. 2022-03-05 14:26:45 -08:00
Erik Eckstein
dccaa8f01f diagnose duplicated @_cdecl and @_silgen_name function names
Prints a regular error instead of crashing.
The check is done in SILGen, because it's simple. We could also do it earlier, but I don't see a strong reason for this.

rdar://75950093
2021-03-31 13:30:22 +02:00
Michael Gottesman
1de2d3f7c0 [ast] Enable the ASTVerifier behind the enable-ast-verifier flag in no-asserts builds.
This follows the design of how we handled this with
sil-verify-all. Specifically, the default behavior is to run only in asserts
builds, but one can use the two flags: enable-ast-verifier and
disable-ast-verifier to override the default behavior.

The reason why this is interesting is that this means that when compiling
normally, we will not run the verifier, so we won't have a perf hit. But we can
now ask the user to run with this flag (or in a future maybe a re-run in the
driver would do this for them), saving us time when screening bugs by avoiding
the need to build an asserts compiler to triage if the ASTVerifier would catch
the bug.
2021-01-25 11:55:47 -08:00
Robert Widmann
363b66a7ad Fully Qualify the Parent Type When Diagnosing Missing Member Types
Use the FullyQualified<Type> abstraction from the prior commit plus DescriptiveDeclKind to give a bit more information when issuing a missing member type diagnostic during type resolution.
2020-11-09 17:10:18 -08:00
Pavel Yaskevich
f24e5dbd26 [Diangostics] NFC: Adjust test-cases to expect that "type cannot conform" diagnostic has a note 2020-10-27 14:54:07 -07:00
Anthony Latsis
2133fe27df Sema: Have TypeResolution accept an unbound generic type opener function 2020-07-08 13:39:34 +03:00
Holly Borla
b871528179 Merge pull request #32524 from OnyekachiSamuel/fix-confusing-protocol-diagnostic
[Diagnostics] Fix Confusing Protocol Diagnostic
2020-07-02 13:01:19 -07:00
Onyekachi Ezeoke
ff26a06257 fix broken test 2020-07-02 03:13:10 +01:00