Doug Gregor
5b320992ea
[Constraint solver] Use a constraint system to apply all function builders.
...
When type checking the body of a function declaration that has a function
builder on it (e.g., `@ViewBuilder var body: some View { ... }`), create a
constraint system that is responsible for constraint generation and
application, sending function declarations through the same code paths
used by closures.
2020-01-09 14:38:45 -08:00
Hamish Knight
6f0f16edbc
[CS] Tighten up assertions for getCalleeDeclAndArgs ( #29077 )
...
[CS] Tighten up assertions for getCalleeDeclAndArgs
2020-01-09 09:15:37 -08:00
Pavel Yaskevich
4c1e2c6ce1
[Diagnostics] Add nullptr check for anchor while fixing function result failures
2020-01-08 17:17:26 -08:00
Doug Gregor
ac24491dae
[Constraint system] Generalize function builder application APIs.
...
Teach the constraint system to handle matching a function builder to a
function as well as a closure.
2020-01-08 16:19:44 -08:00
Holly Borla
9ddb5eddc5
Merge pull request #29065 from hborla/subscript-error-diag
...
[Diagnostics] Finish porting subscript errors
2020-01-08 16:05:04 -08:00
Hamish Knight
1a8477aea1
[CS] NFC: Inline getCalleeDeclAndArgs
2020-01-08 13:39:00 -08:00
Hamish Knight
c6b6e72aac
[CS] Tighten up assertions for getCalleeDeclAndArgs
...
Assert that we have a correct locator and that we
recorded argument information for it, rather than
returning no information.
In addition, always return the callee locator,
even if there is no callee.
2020-01-08 13:38:59 -08:00
Holly Borla
7e056671a3
[CSGen] Abstract checking for a nil literal in visitSubscriptExpr into a
...
general isValidBaseOfMemberRef function.
2020-01-08 13:36:32 -08:00
swift_jenkins
9ce6844ff8
Merge remote-tracking branch 'origin/master' into master-next
2020-01-08 10:38:32 -08:00
Pavel Yaskevich
7cfd3cb512
Merge pull request #29064 from LucianoPAlmeida/handle-csdiag-coerce-diagnostics
...
[Diagnostics] Removing FailureDiagnosis::visitCoerceExpr from CSDiag
2020-01-08 10:18:52 -08:00
swift_jenkins
8a3c5c753b
Merge remote-tracking branch 'origin/master' into master-next
2020-01-08 09:57:24 -08:00
Varun Gandhi
d919bfa1eb
Merge pull request #29049 from varungandhi-apple/vg-v4-clang-types-in-swiftinterface
...
Re-land parsing and printing for Clang function types.
2020-01-08 09:41:17 -08:00
Arnold Schwaighofer
43c24be5cd
Merge remote-tracking branch 'upstream/master' into master-next
2020-01-08 06:41:34 -08:00
Luciano Almeida
4443966f3d
[CSDiagnostics] Removing duplicated diagnose for InstanceType
2020-01-08 07:11:17 -03:00
Luciano Almeida
4d982f3430
[CSSimplify] Do not record fix to coerce with existential restriction
2020-01-08 07:07:49 -03:00
Luciano Almeida
fc49af2949
[CSSimplify] Handle coercion to wrong type for function result locator
2020-01-08 07:07:49 -03:00
Luciano Almeida
0e1a03dc61
[CSSimplify] Handle optional wrong type conversion
2020-01-08 07:07:49 -03:00
Luciano Almeida
06201a64be
[Sema] Diagnose wrong type coercion involving metatypes
2020-01-08 07:07:49 -03:00
Luciano Almeida
18f52dcbb0
[CSDiag] Remove visitCoerceExpr from CSDiag
2020-01-08 07:07:48 -03:00
Pavel Yaskevich
66fe1ec2b2
Merge pull request #29053 from xedin/port-ternary-diags
...
[Diagnostics] Detect and diagnose ternary branch type mismatches
2020-01-08 00:27:32 -08:00
Dan Zheng
c9c51beda3
[AutoDiff] Attribute gardening. ( #29050 )
...
Upstream changes from `tensorflow` branch:
- https://github.com/apple/swift/pull/28932 : deprecate `@differentiable(jvp:vjp)` arguments.
- https://github.com/apple/swift/pull/29038 : gardening.
Additional gardening included.
2020-01-07 19:24:52 -08:00
David Zarzycki
89c5c0e4cc
Merge pull request #29013 from davezarzycki/pr29013
...
NFC: Fix -Wdeprecated-copy warnings
2020-01-07 21:29:10 -05:00
Holly Borla
e26794a11c
[CSDiag] Remove diagnoseSubscriptErrors from CSDiag
2020-01-07 17:37:38 -08:00
Holly Borla
834eee6f4e
[Diagnostics] Implement MissingArgumentsFailure::diagnoseAsNote in order
...
to diagnose ambiguities due to missing arguments.
2020-01-07 17:37:38 -08:00
Holly Borla
42c73334f0
[CSGen] Diagnose subscripting a nil literal in CSGen.
2020-01-07 17:37:38 -08:00
Varun Gandhi
afc6ccdeb5
Re-land parsing and printing for Clang function types.
...
This reverts commit e805fe486e , which reverted
the change earlier. The problem was caused due to a simultaneous change to some
code by the PR with parsing and printing for Clang function types (#28737 )
and the PR which introduced Located<T> (#28643 ).
This commit also includes a small change to make sure the intersecting region
is fixed: the change is limited to using the fields of Located<T> in the
`tryParseClangType` lambda.
2020-01-07 15:58:32 -08:00
Holly Borla
43712bb860
[Diagnostics] Diagnose general ambiguity failures in diagnoseAmbiguityWithFixes.
2020-01-07 15:05:54 -08:00
Pavel Yaskevich
9a62701e95
[ConstraintSystem] Use new branch element and fix mismatch between ternary branches
2020-01-07 13:50:09 -08:00
David Zarzycki
3d1739fa86
NFC: Fix -Wdeprecated-copy warnings
2020-01-07 16:09:00 -05:00
Pavel Yaskevich
be3f949a43
[Diagnostics] Add support for new "ternary branch" element to contextual mismatch
2020-01-07 12:07:02 -08:00
Pavel Yaskevich
e19ef090b4
[ConstraintSystem] Add a new locator element to denote branches of ternary operator
...
`TernaryBranch` with a boolean flag to identify "then" (true) or
"else" (false) branches of the ternary operator expression.
2020-01-07 09:11:37 -08:00
Doug Gregor
d903ca9a9c
Merge pull request #29026 from DougGregor/generalize-solution-apply
...
Generalize solution application
2020-01-06 21:04:55 -08:00
swift-ci
b6e0ffd6ba
Merge pull request #29031 from marcrasi/forbid-protocol-req
2020-01-06 20:41:53 -08:00
Robert Widmann
19f0d52eca
Merge pull request #28995 from CodaFi/absolutely-path-ological
...
[NFC] Hide SourceFile::Decls
2020-01-06 18:48:55 -08:00
Saleem Abdulrasool
e805fe486e
Revert "Clang function types v2: Electric Boogaloo (parsing + printing)"
2020-01-06 16:26:08 -08:00
Marc Rasi
d69e892f03
[AutoDiff upstream] forbid @derivative of protocol req
2020-01-06 15:57:35 -08:00
Varun Gandhi
4a1a17d029
Merge pull request #28737 from varungandhi-apple/vg-v3-clang-types-in-swiftinterface
...
Clang function types v2: Electric Boogaloo (parsing + printing)
2020-01-06 15:42:30 -08:00
Varun Gandhi
022314a640
Merge pull request #28643 from kitaisreal/using-located-instead-of-pair
...
[Compiler]: Using Located<T> instead of std::pair<SourceLoc, T>
2020-01-06 14:22:29 -08:00
Varun Gandhi
afc6332289
[Sema] Parse a Clang function type from the cType argument.
2020-01-06 13:00:04 -08:00
swift_jenkins
70bfa0cfc1
Merge remote-tracking branch 'origin/master' into master-next
2020-01-06 12:17:27 -08:00
Robert Widmann
231773357b
Merge pull request #28629 from CodaFi/convenience-never-comes-without-cost
...
[Shepherd] Support classes with missing designated inits
2020-01-06 12:07:29 -08:00
swift_jenkins
6d299dbd53
Merge remote-tracking branch 'origin/master' into master-next
2020-01-06 11:57:32 -08:00
Dan Zheng
8bd3e2d40d
[AutoDiff] Upstream minor changes from tensorflow branch. ( #29018 )
...
Upstream derivative function lookup changes from
https://github.com/apple/swift/pull/28935 .
2020-01-06 11:56:23 -08:00
Doug Gregor
fffe1291fa
[Constraint system] Generalize record of transformed function builders.
2020-01-06 11:39:11 -08:00
swift_jenkins
de4b67b50d
Merge remote-tracking branch 'origin/master' into master-next
2020-01-06 11:37:30 -08:00
Pavel Yaskevich
36fff23077
Merge pull request #29011 from LucianoPAlmeida/coercion-handle-contextual-mismatch
...
[Diagnostics] Handle CoerceExpr conversion failure in contextual mismatch
2020-01-06 11:31:12 -08:00
Doug Gregor
dfda7aca7f
[Constraint solver] Generalize "target" of solution application.
...
Chip away at the expression-centric nature of the constraint system by
generalizing the "target" of solution application from a single
expression to a a "SolutionApplicationTarget", which can be an
expression or a function body. The latter will be used for applying
function builders to an entire function body.
2020-01-06 11:31:06 -08:00
swift_jenkins
e10a2e98f9
Merge remote-tracking branch 'origin/master' into master-next
2020-01-06 10:18:55 -08:00
Harlan Haskins
283854a012
[Sema] Requestify hasMissingDesignatedInitializers
...
We’re going to start serializing this for public types that have non-public-or-@usableFromInline initializers, so turn it into a request that we can query and cache it in the existing bit.
2020-01-06 10:15:07 -08:00
Pavel Yaskevich
b133b7e3da
Merge pull request #28910 from xedin/rdar-56436235
...
[TypeChecker] Treat tuples specially while validating checked casts
2020-01-06 10:03:29 -08:00