Slava Pestov
387156ae11
Merge pull request #71354 from slavapestov/check-type-witness-fix
...
Sema: Fix problems with checkTypeWitness()
2024-02-03 08:28:14 -05:00
Slava Pestov
477e0572c2
Sema: Tighten invariants in associated type inference
2024-02-02 23:30:44 -05:00
Slava Pestov
ea15d9f9b2
Stop passing -warn-redundant-requirements in tests
2024-02-02 14:57:19 -05:00
Slava Pestov
991a6de207
Merge pull request #71131 from slavapestov/conformance-checker-vs-type-witnesses-untangling
...
Sema: Decouple type witness resolution from the ConformanceChecker
2024-01-25 20:06:01 -05:00
Slava Pestov
2764333fea
Sema: Introduce ResolveTypeWitnessesRequest
2024-01-24 21:45:34 -05:00
Kavon Farvardin
ba2f05cce2
NCGenerics: adjust number of diagnostics
...
Something I changed in the implementation of NoncopyableGenerics has
gotten the number back down to 6, where it was before I started :)
2024-01-23 22:42:38 -08:00
Slava Pestov
0b0ad738dd
AST: Record a HadError bit in DelayedConformanceDiags
2024-01-20 19:16:58 -05:00
Slava Pestov
5d58a634ad
Sema: Clean up openType() and openUnboundGenericType()
...
Fixes:
- rdar://112785081
- https://github.com/apple/swift/issues/67906
- https://github.com/apple/swift/issues/68160
2024-01-09 15:23:42 -05:00
Slava Pestov
335d6ffea1
Frontend: Add -disable-experimental-associated-type-inference flag
2023-12-08 13:39:10 -05:00
Slava Pestov
e29c3a90aa
AST: Lazily populate associated conformances with -enable-experimental-associated-type-inference
2023-12-07 19:27:59 -05:00
Slava Pestov
b1ed3c270c
Add regression tests for rdar://116434843 and #59772
2023-12-07 19:27:59 -05:00
Slava Pestov
e65290c2bd
Sema: Associated type inference skips witnesses that might trigger a request cycle
...
This implements a structural walk over the TypeRepr to catch
situations where we attempt to infer `A` from `func f(_: A)`,
which references the concrete `A` that will be synthesized
in the conforming type.
Fixes:
- rdar://34956654 / https://github.com/apple/swift/issues/48680
- rdar://38913692 / https://github.com/apple/swift/issues/49066
- rdar://56672411
- https://github.com/apple/swift/issues/50010
- rdar://81587765 / https://github.com/apple/swift/issues/57355
- rdar://117442510
2023-11-14 12:08:59 -05:00
Kavon Farvardin
0f2a8d5ea7
bump number of diags in 0161-issue-49119.swift
...
Seems we already emit 6 duplicate diagnostics for this test, so what's
one more?
I'm not sure what change I made triggered this additional diagnostic.
2023-10-18 20:02:17 -07:00
Nishith Shah
8e2e625543
[Diagnostics] Use imperative msg for protocol conformance & switch-case fixits
...
This commit changes fixit messages from a question/suggestion to an
imperative message for protocol conformances and switch-case. Addresses
https://github.com/apple/swift/issues/67510 .
2023-08-13 22:34:26 -07:00
Slava Pestov
64eb9dfbd4
Merge pull request #67798 from slavapestov/fix-rdar113103854
...
Sema: Fix a couple of problems in checkContextualRequirements()
2023-08-09 20:12:11 -04:00
Slava Pestov
a7c276bd14
Update 0161-issue-49119.swift
2023-08-09 17:11:11 -04:00
Slava Pestov
fbd1f1acbd
Sema: Fix a couple of problems in checkContextualRequirements()
...
The original bug was a crash-on-invalid with a missing '}', but it
actually exposed a bug with nested protocols (SE-0404) and another
long-time bug.
- Whatever we do, we should skip this for protocols because their 'Self'
parameter is not bound from context.
- getTrailingWhereClause() is not the right proxy for "has a generic
signature different than its parent", in particular it doesn't
round-trip through serialization. Instead, just compare generic
signatures for pointer equality in the early return check.
The second change is source-breaking because it was possible to
write a nested type with a `where` clause and use it contradicting
its requirements across a module boundary.
Fixes rdar://113103854.
2023-08-08 15:06:08 -04:00
Slava Pestov
4ebbb60fae
Regression test for rdar://problem/113492450
2023-08-08 11:03:11 -04:00
Holly Borla
43c300408b
[NFC] Update additional parameter pack tests.
2023-07-20 15:36:20 -07:00
Slava Pestov
9e73dad311
Merge pull request #67342 from slavapestov/open-type-workaround
...
Sema: Workaround for issue in ConstraintSystem::openType()
2023-07-19 07:49:45 -04:00
Slava Pestov
e0a1a11a6b
SIL: Fix substituted function type visitor for PackExpansionType with concrete pattern type
...
If the pattern doesn't have any pack parameters in it anymore,
we need to recover the substituted count type from the original
count type.
Fixes rdar://problem/112065340.
2023-07-18 12:19:22 -04:00
Slava Pestov
415b70584a
Sema: Workaround for issue in ConstraintSystem::openType()
2023-07-17 15:33:34 -04:00
Slava Pestov
e6253b282a
AST: Re-implement mapPackTypeIntoElementContext() in terms of mapContextualPackTypeIntoElementContext()
2023-07-12 18:02:14 -04:00
Slava Pestov
e01822ca20
Add regression test for rdar://problem/108319167
2023-07-03 18:41:44 -04:00
Slava Pestov
7cc8063889
SIL: Forgot to pass SubstFlags::PreservePackExpansionLevel in one place
2023-06-07 15:17:54 -04:00
Pavel Yaskevich
697dfbae96
[TypeChecker] Enable result builder AST transform by default
2022-12-21 10:31:30 -08:00
Luciano Almeida
0db4b43f6d
Merge pull request #61863 from LucianoPAlmeida/crash-dump-parse-init
...
[ASTDumper] Special handling for init kind in pre-typecheck dump
2022-12-16 09:42:31 -03:00
Pavel Yaskevich
65e7eec62f
[CSSolver] Solve multi-statement closures in source order
...
Currently solver picks the first conjunction it can find,
which means - the earliest resolved closure. This is not
always correct because when calls are chained closures
passed to the lower members could be resolved sooner
than the ones higher up but at the same time they depend
on types inferred from members higher in the chain.
Let's make sure that multi-statement closures are always
solved in order they appear in the AST to make sure that
types are available to members lower in the chain.
2022-12-12 10:57:21 -08:00
Luciano Almeida
70b884cf08
[ASTDumper] Special handling for init kind in pre-typecheck dump
2022-12-06 22:50:00 -03:00
Slava Pestov
3dc7a2decd
Sema: Fix substMemberTypeWithBase() for non-generic typealias with 'where' clause
...
getContextSubstitutionMap() builds a substitution map for the generic signature of
the parent context, which is wrong if the typealias has its own 'where' clause.
2022-11-28 23:57:53 -05:00
Slava Pestov
abfe49fd3d
Disable 0022-rdar21625478.swift entirely on noassert builds
...
Fixes rdar://problem/99800538.
2022-11-11 23:31:06 -05:00
Anthony Latsis
c55218d0e8
Merge pull request #61132 from AnthonyLatsis/migrate-test-suite-to-gh-issues-27
...
Gardening: Migrate test suite to GH issues p. 27
2022-09-28 05:10:40 +03:00
Anthony Latsis
34f78b2f8e
Gardening: Migrate test suite to GH issues: validation-test/compiler_crashers_2_fixed (4/4)
2022-09-27 23:44:12 +03:00
Anthony Latsis
24ac121da1
Gardening: Migrate test suite to GH issues: validation-test/compiler_crashers_2_fixed (3/4)
2022-09-27 23:44:05 +03:00
Anthony Latsis
3304744698
Merge pull request #61130 from AnthonyLatsis/migrate-test-suite-to-gh-issues-26
...
Gardening: Migrate test suite to GH issues p. 26
2022-09-27 08:01:51 +03:00
Anthony Latsis
06195573f2
Gardening: Migrate test suite to GH issues: validation-test/compiler_crashers_2_fixed (2/4)
2022-09-27 03:14:58 +03:00
Anthony Latsis
2577af7967
Gardening: Migrate test suite to GH issues: validation-test/compiler_crashers_2_fixed (1/4)
2022-09-27 03:14:39 +03:00
Drew Maxwell
7825221cd4
Updating Swift tests to remove outdated tests and use more current calls.
2022-09-16 15:11:10 -07:00
Doug Gregor
714eee0f52
Merge pull request #60720 from DougGregor/attribute-eof-parser-loop
2022-08-23 06:48:05 -07:00
Doug Gregor
28e1c304cf
Allow declaration recovery to consume attributes.
...
Fixes https://github.com/apple/swift/issues/60702 / rdar://98967894
2022-08-22 21:45:25 -07:00
Holly Borla
cd7bc86bb1
[Test] Update error message in validation test.
2022-08-22 17:07:25 -04:00
Alex Hoppen
57d504cbcd
Merge pull request #60062 from ahoppen/pr/placeholder-for-errors
...
[CS] Don’t fail constraint generation for ErrorExpr or if type fails to resolve
2022-07-20 14:15:43 +02:00
Alex Hoppen
e14fa7291f
[CS] Don’t fail constraint generation for ErrorExpr or if type fails to resolve
...
Instead of failing constraint generation by returning `nullptr` for an `ErrorExpr` or returning a null type when a type fails to be resolved, return a fresh type variable. This allows the constraint solver to continue further and produce more meaningful diagnostics.
Most importantly, it allows us to produce a solution where previously constraint generation for a syntactic element had failed, which is required to type check multi-statement closures in result builders inside the constraint system.
2022-07-20 09:46:12 +02:00
nate-chandler
1e30ea9bff
Merge pull request #60073 from nate-chandler/rdar81704151
...
[Test] Reenabled two tests.
2022-07-18 11:52:17 -07:00
Nate Chandler
674fc2c33a
[Test] Reenabled two tests.
...
They should have been reenabled earlier.
rdar://81704151
2022-07-15 13:47:24 -07:00
Anthony Latsis
58a9778136
Add fixed crasher to close #43442
2022-07-09 16:47:55 +03:00
Alex Hoppen
97368698d4
Merge pull request #59664 from ahoppen/pr/cast-with-no-type
...
[TypeChecker] Don’t crash if a ExplicitCastExpr doesn’t have a cast type
2022-06-29 09:31:38 +02:00
Alex Hoppen
28a8e0762d
[TypeChecker] Don’t crash if a ExplicitCastExpr doesn’t have a cast type
...
If the type of an `ExplicitCastExpr` is not valid, it is a null type, which causes a crash when checking if the cast type has parameterized existentials.
rdar://95629905
2022-06-27 17:21:53 +02:00
Anthony Latsis
767423a3c9
Add regression test to close #59572
2022-06-22 22:17:33 +03:00
Doug Gregor
774a94f69d
Make sure we can dig out the (distributed) actor from an archetype.
...
Fixes #59356 / rdar://94976378.
2022-06-14 10:57:29 -07:00