Doug Gregor
efd357e7c7
[Constraint system] Factor out application to a SolutionApplicationTarget.
...
Pull out the core operation of rewriting a given SolutionApplicationTarget
into into a method on the ExprWalker that does the overall rewrite, so it
can be called multiple times within application.
2020-02-12 17:51:47 -08:00
Slava Pestov
06855f758d
AST: Remove a couple of redundant statistics
2020-02-12 18:29:27 -05:00
Vuk Radosavljevic
a570e9330f
Removed using desugard type and changed impact from 1 to 10
2020-02-12 17:29:22 -06:00
Vuk Radosavljevic
41e2411752
[CSSimplify] Increment impact by 1 for DefineMemberBasedOnUse when base type is any function type
2020-02-12 14:49:19 -06:00
Holly Borla
24826e01bd
Merge pull request #29775 from hborla/parse-type-eraser-attribute
...
[Parse] Add an attribute for typeEraser.
2020-02-12 09:58:14 -08:00
Doug Gregor
8b5a639769
Merge pull request #29778 from DougGregor/more-sinking
...
[Constraint system] Sink optional “some” pattern handling into constrain generation
2020-02-11 20:13:38 -08:00
Doug Gregor
a308a7e53c
[Constraint system] Sink down debug logging.
...
This way we’ll see constraints whenever they’re generated, and remove some
of the expression-centric nature of the top-level solve() and solveImpl().
2020-02-11 17:33:08 -08:00
Holly Borla
ffba71b889
[Parse] Add an attribute for typeEraser.
...
This will be used for compiler-driven type erasure for dynamic
replacement of functions with an opaque return type. For now, just
parse the attribute and ignore it.
2020-02-11 17:30:21 -08:00
Doug Gregor
bddee5cff2
[Constraint system] Move shrinking back into typeCheckExpression()
...
We only want this at the top level, not during the middle of constraint
generation.
2020-02-11 17:24:38 -08:00
Doug Gregor
151fc79264
Merge pull request #29770 from DougGregor/builder-transform-node-types
...
[Constraint solver] Fix handling of node types for function builder application
2020-02-11 17:21:16 -08:00
Doug Gregor
17e1c91b4b
[Constraint system] Sink optional “some” pattern handling into constraint gen
2020-02-11 17:11:31 -08:00
marcrasi
565b0e17fd
change "new" to "malloc" because it gets "free"d later ( #29767 )
2020-02-11 16:03:32 -08:00
Robert Widmann
054d7b9913
Merge pull request #29713 from CodaFi/unused-unwanted-unloved
...
[Gardening] Silence Some Warning Spew
2020-02-11 15:46:16 -08:00
Doug Gregor
4c98b31031
[Constraint solver] Apply solution to the system before builder transform.
...
This makes sure we can find information in the constraint system during
application. Fixes rdar://problem/59239224
2020-02-11 15:14:44 -08:00
Doug Gregor
3508dfb0ea
[Constraint system] Use hash table lookup appropriately.
...
It’s pointlessly inefficient to do an O(n) scan through a hash table to match
keys!
2020-02-11 15:14:44 -08:00
Doug Gregor
f5b9517552
[Constraint system] Simplify and improve handling of node tyoes.
...
Rather than having separate dense maps for the type mappings of each
node type (expression, type location, variable declaration, pattern) that
a TypedNode can be, have a single such map. Sometimes we end up
setting a particular node's type more than once, so cope with that
by restoring the prior type.
2020-02-11 15:14:44 -08:00
Holly Borla
ab59032ebb
[CSDiag] Remove obsolete ambiguity code.
2020-02-11 14:53:27 -08:00
Holly Borla
d1f6b3e2ef
[Diagnostics] When diagnosing an ambiguous overload, don't mention "call"
...
if the expression is not a function application.
2020-02-11 14:53:27 -08:00
Holly Borla
1a628f3107
[Diagnostics] Simplify logic in diagnoseAmbiguityWithFixes for emitting
...
the ambiguity diagnostic by combining a few special errors into one.
2020-02-11 14:53:27 -08:00
Holly Borla
651c27b50b
[Diagnostics] Add CSFix::diagnoseForAmbiguity for diagnosing common
...
fixes that appear in all solutions.
2020-02-11 14:53:27 -08:00
Holly Borla
54706ba79b
[Diagnostics] Simplify diagnoseAmbiguityWithFixes by removing AmbiguityKind.
2020-02-11 14:53:27 -08:00
Holly Borla
607c298493
[Diagnostics] Refactor diagnoseAmbigutiyWithFixes to use the differences between
...
solutions in order to figure out the source of ambiguity.
2020-02-11 14:52:41 -08:00
Doug Gregor
44b5d6446c
Merge pull request #29728 from DougGregor/sink-init-pattern-constraints
...
[Constraint solver] Sink down initialization pattern handling
2020-02-11 12:01:55 -08:00
Suyash Srijan
211394099f
[CSDiagnostics] Offer a fix-it to insert a return type placeholder when returning from a void function ( #29747 )
...
* [CSDiagnostics] Offer a fix-it to insert a return type when returning from a void function
* [CSDiagnostics] Make sure the function name is not empty
The function name will be empty in some cases, for example for property setters. In cases where the function name is empty, skip the note and fix-it.
* [Test] Update existing diagnostics
2020-02-11 10:25:16 +00:00
Pavel Yaskevich
b3590c5f1d
Merge pull request #29734 from LucianoPAlmeida/remove-diag-parameters-errors
...
[Diagnostics] Remove `FailureDiagnosis::diagnoseParameterErrors` from CSDiag
2020-02-11 01:32:31 -08:00
Doug Gregor
97aaa8a229
[Constraint solver] Make sure to reflect pattern updates after application.
2020-02-10 22:01:37 -08:00
Doug Gregor
a1932f10e5
[Constraint solver] Sink remaining logic from typeCheckBinding.
...
Move the remaining logic of typeCheckBinding, which consists of applying
the solution to the pattern, down into the normal solution application
path. typeCheckBinding() is now a thin shell over the normal
typeCheckExpression() convenience function.
2020-02-10 22:01:37 -08:00
Doug Gregor
364770e658
[Constraint system] Remove typeCheckBinding’s ExprTypeCheckListener.
...
Sink the solution-application code from typeCheckBinding’s
ExprTypeCheckListener subclass into normal solution application, allowing
us to eliminate this subclass entirely. Down to one…
2020-02-10 22:01:37 -08:00
Doug Gregor
c1c7112110
Remove some unused code and fix a test
2020-02-10 22:01:37 -08:00
Doug Gregor
4d1de7fd3d
[Constraint solver] Sink down initialization pattern constraint generation.
...
Sink the constraint generation for initialization patterns, including all
of the logic for property wrappers, from the high-level entry point
`typeCheckBinding` down into the lower-level constraint generation for
solution application targets.
2020-02-10 22:01:37 -08:00
Doug Gregor
a2640b73ee
[Constraint system] Finish allowing one to record pattern types.
2020-02-10 22:01:37 -08:00
Luciano Almeida
46092aff3e
[tests] Adjusting tests under type/opaque
2020-02-10 07:48:34 -03:00
Luciano Almeida
449ab7383f
[ConstraintSystem] Disambiguate cases of argument/param mismatches involving generic functions
2020-02-09 21:19:01 -03:00
Luciano Almeida
cc29dc5d6b
[CSDiag] Removing diagnose parameter error from CSDiag
2020-02-09 17:14:04 -03:00
swift-ci
91269532cd
Merge remote-tracking branch 'origin/master' into master-rebranch
2020-02-08 20:43:24 -08:00
Doug Gregor
caf2f62ea3
Merge pull request #29717 from DougGregor/init-via-solution-target
...
[Constraint system] Sink initialization logic into SolutionApplicationTarget
2020-02-08 20:38:09 -08:00
Luciano Almeida
5572832368
[CSSimplify] Remove diagnostics obsolete diagnostics checks involving CSDiag logic
2020-02-08 12:11:11 -03:00
Doug Gregor
d70c055888
[Constraint system] Sink more init logic into SolutionApplicationTarget
...
More steps toward eliminating ExprTypeCheckListener.
2020-02-07 22:46:05 -08:00
Doug Gregor
614f618e5d
[Constraint system] Allow recording pattern types in the system.
2020-02-07 21:32:13 -08:00
Doug Gregor
efd4152061
[Constraint solver] Factor constraint generation logic for solution targets
...
Move more constraint generation logic for an expression target into a
new generateConstraints() on a solution target, so we can further
generalize the main “solve” logic.
2020-02-07 20:56:32 -08:00
Robert Widmann
66f2733045
[Gardening] Use cast results where possible
2020-02-07 16:09:31 -08:00
Robert Widmann
0e6dc0cd72
[Gardening] getAttribute -> hasAttribute
2020-02-07 16:09:31 -08:00
Robert Widmann
d2360d2e8c
[Gardening] dyn_cast -> isa
2020-02-07 16:09:31 -08:00
swift-ci
668efa4f15
Merge remote-tracking branch 'origin/master' into master-rebranch
2020-02-07 10:04:42 -08:00
Pavel Yaskevich
d92f7c78ff
Merge pull request #29700 from xedin/rdar-59208419
...
[ConstraintSystem] Favor resolving closures over any disjunction bind…
2020-02-07 09:47:48 -08:00
Pavel Yaskevich
a54fbab8fd
[ConstraintSystem] Favor resolving closures over any disjunction binding type variables
...
Fix a case where favoring didn't account for "bound" type variable
being wrapped into optional(s) (disjunctions like that are used for
optional conversions). Doing so makes sure that closure result type
is not bound before the body of the closure is "opened", that's
important because body could provide additional context required
to bind result type e.g. `{ $0 as? <Type> }`.
Resolve: rdar://problem/59208419
2020-02-07 00:26:22 -08:00
swift-ci
0cbfcbb517
Merge remote-tracking branch 'origin/master' into master-rebranch
2020-02-06 21:44:26 -08:00
Robert Widmann
1ed846d852
Merge pull request #25696 from kelvin13/comparable-enums
...
synthesized comparable for enums
2020-02-06 21:38:36 -08:00
swift-ci
c8671f672b
Merge remote-tracking branch 'origin/master' into master-rebranch
2020-02-06 21:04:42 -08:00
John McCall
b46938924f
Merge pull request #29670 from rjmccall/ciliainig-teyepee-sieeriiieaileiizieaitieieoiniie
...
Implement Swift serialization and deserialization of Clang types
2020-02-07 00:04:30 -05:00