Commit Graph

8 Commits

Author SHA1 Message Date
Mark Lacey
3e5418e4bd Rename some existing test functions and add more ranking tests. 2018-07-23 11:52:59 -07:00
Mark Lacey
27649e5ced Start to build up ranking tests.
We don't have a great collection of tests for the ranking that we do
in the constraint solver. This is a very simple beginning that I will
build on in further commits.

The primary aim here is to document the current state of how we're
selecting things, and make note of anything that doesn't seem like the
right long term choice so that we can begin to address the issues.

This is largely motivated at the moment by the changes I had to revert
for dealing with Optional and Any in ranking, which on both ranking
changes and scoring changes, the latter of which inadvertantly changed
other behavior about how we ultimately select a final solution in type
checking.
2018-07-20 00:09:53 -07: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
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Doug Gregor
5fc8ac7fd1 Require the 'override' keyword for initializers that override designated initializers.
Swift SVN r20490
2014-07-24 15:38:33 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Doug Gregor
91ffa957b9 Add very basic support for selecting the best solution when the
constraint solver produces multiple solutions. The criteria for "best"
are fairly simple: we compare the bindings for each type variable
bound in both solutions:

  - If the binding in the first solution is a subtype of the binding
    in the second solution, but not vice-versa, the first solution is
    at least as good as the second
  - If the type variable has a literal constraint on it, and the bound
    type in the first solution matches the default literal type for
    that literal kind, the first solution is as good as the second.

From there, we follow the obvious rules for picking a winner: if some
of the type variables in the first solution are as good as the same type
variables in the second solution, but none of the type variables are
worse, then the first solution is better.

We can now type-check "1 + 2.0". Take *that*, TypeCheckCoercion.cpp.



Swift SVN r2894
2012-09-21 18:31:25 +00:00