Commit Graph

13 Commits

Author SHA1 Message Date
Mark Lacey
21fd184e0d Disable an "expression too complex" test for now.
I've opened https://bugs.swift.org/browse/SR-4714 to track fixing the
slowness here and/or moving the test into the validation suite.

We're currently not "too complex" here given the current metric, but we
are still extremely slow, adding several minutes to test runs.
2017-04-26 14:57:04 -07:00
Max Moiseev
e35b3c957b Fixing the complex expression test 2017-04-17 10:24:29 -07:00
Mark Lacey
d28da64850 [Constraint solver] Disabling the shrink() pass results in new ambiguities.
One expression in this test becomes ambiguous when the shrink() pass is
disabled. Enabling the constraint propagation pass disables the shrink
pass.

For now we'll run this with -propagate-constraints explicitly enabled
and with the expected output changed. This is a regression that will
need to be investigated and fixed in the solver.
2017-04-15 20:18:09 -07:00
Colin Douglas Howell
fb235125fb [CSGen] Fix for exponential dictionary literal behavior in SR-3668
In ConstraintGenerator::visitDictionaryExpr(), if the dictionary_expr has a
contextual type which is also a dictionary type, use it to add a new type
constraint for each of the dictionary_expr's elements. This has a huge effect
on solver performance for dictionary literals with elements that have
overloading. The approach closely follows that used in
ConstraintGenerator::visitArrayExpr(), which has included a similar
optimization (from git commit a22b391) for over two and a half years.

I've also added a couple of new test cases which would trigger the bug without
this fix.
2017-01-21 23:47:01 -08:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
practicalswift
b19481f887 [gardening] Fix 67 recently introduced typos 2016-09-16 11:16:07 +02:00
Pavel Yaskevich
73318a2132 [Type Checker] Extend Path Consistency algorithm to cover collections
ExprCollector is extended to cover all generic collections instead of
only dictionary expressions. Contextual type propagation is extended
to support partial solving of collections embedded into coerce expressions.
2016-09-14 13:51:08 -07:00
Erik Eckstein
38cb48b29a Revert "[Type Checker] Extend Path Consistency algorithm to cover collections"
This reverts commit f590a1ba03.

It breaks this kind of code:

test.swift:2:34: error: cannot convert value of type 'Int' to expected element type 'UInt32'
 let lengthBytes: [UInt32] = [55 * 8, 0]
                              ~~~^~~
                              UInt32( )
2016-09-14 11:15:34 -07:00
Pavel Yaskevich
f590a1ba03 [Type Checker] Extend Path Consistency algorithm to cover collections
ExprCollector is extended to cover all generic collections instead of
only dictionary expressions. Contextual type propagation is extended
to support partial solving of collections embedded into coerce expressions.
2016-09-13 01:34:14 -07:00
Pavel Yaskevich
2011e502ad [Type Checker] Prevent Path Consistency algorithm from aborting too aggressively
Instead of failing shrinking when there are no solutions for current
sub-expression, let's restore overload domains for previously solved
sub-expressions and move on trying to solve next expression in the queue.
2016-08-26 17:21:04 -07:00
Pavel Yaskevich
8e04a84239 [Type checker] Introduce directional path consistency algorithm
DPC algorithm tries to solve individual sub-expressions and combine
resolved types as a way to reduce pre-existing OSR domains. Solving
is done bottom-up so each consecutive sub-expression tightens
possible solution domain even further.
2016-08-24 18:40:28 -07:00
Mishal Shah
a84704f4b5 Revert "[Type checker] Introduce directional path consistency algorithm" 2016-08-24 17:53:12 -07:00
Pavel Yaskevich
de51b01195 [Type checker] Introduce directional path consistency algorithm
DPC algoritm tries to solve individual sub-expressions and combine
resolved types as a way to reduce pre-existing OSR domains. Solving
is done bottom-up so each consecutive sub-expression tightens
possible solution domain even further.
2016-08-24 14:38:46 -07:00