Commit Graph

5277 Commits

Author SHA1 Message Date
Rintaro Ishizaki
5e001f1913 Merge pull request #18626 from rintaro/ide-completion-unresolved-refactor
[CodeCompletion] Completion for UnresolvedMember via CodeCompletionExpr
2018-08-11 09:10:28 +09:00
Rintaro Ishizaki
3bff834f22 Merge pull request #18625 from rintaro/rdar43057058
[CSGen] Rework SanitizeExpr
2018-08-11 08:23:09 +09:00
Arnold Schwaighofer
b62c6e64ff Codesign validation-test/stdlib 2018-08-10 09:39:09 -07:00
Arnold Schwaighofer
7e4ce9a575 Codesign more tests 2018-08-10 06:58:40 -07:00
Rintaro Ishizaki
b5a537ea26 [CodeCompletion] Add fixed test case fixed in previous commit
rdar://problem/42828673
2018-08-10 22:23:23 +09:00
Rintaro Ishizaki
33e7d06cbf [CodeCompletion] Add previously crashing test case. 2018-08-10 20:30:19 +09:00
Graydon Hoare
a2fb9991ce <rdar://42816290> Attempt to make overlong-argv test less flaky. 2018-08-09 15:38:28 -07:00
Arnold Schwaighofer
5ebc6e77e7 Codesign the reflection tests 2018-08-09 09:18:04 -07:00
Rintaro Ishizaki
5217b68f08 [Parse] Set ErrorType to invalid ParamDecl
TypeChecker assumes invalid decl has valid type.

https://bugs.swift.org/browse/SR-8475
rdar://problem/43057057
2018-08-09 15:55:33 +09:00
Slava Pestov
8d4b8e31aa Sema: Remove ScalarToTuple conversion
This either became dead shortly after the removal of Swift 3
compatibility mode from the constraint solver, or even earlier.

Note that the code completion test change is actually correct
because (Any) -> () is not convertible to () -> () in the
language.
2018-08-08 10:18:52 -07:00
Pavel Yaskevich
65e67034f8 Merge pull request #18550 from xedin/improve-conformance-req-diags
[Diagnostics] Improve missing conformance diagnostics by using affect…
2018-08-08 00:36:40 -07:00
Pavel Yaskevich
ba085e5bdc [Diagnostics] Improve missing conformance diagnostics for sub-types and members
If generic parameter associated with missing conformance comes
from different context diagnose the problem as "referencing" a
specific declaration from affected type.
2018-08-07 18:55:43 -07:00
Mark Lacey
11eaf7db64 Disable test that seems to be flaky at the moment. 2018-08-07 16:00:08 -07:00
Pavel Yaskevich
ad171e05cc [Diagnostics] Improve missing conformance diagnostics by using affected declaration
Instead of simply pointing out which type had conformance failures,
let's use affected declaration instead, which makes diagnostics much
richer e.g.

```
'List<[S], S.Id>' requires that 'S.Id' conform to 'Hashable'
```

versus

```
initializer 'init(_🆔)' requires that 'E' conform to 'Hashable' [with 'E' = 'S.Id']
```

Since latter message uses information about declaration, it can also
point to it in the source. That makes is much easier to understand when
problem is related to overloaded (function) declarations.
2018-08-07 12:59:53 -07:00
Pavel Yaskevich
dc6f86d9b7 [CSRanking] Fix solution filtering not to erase everything when set is completely ambiguous
Since constraint solver has been improved to diagnose more problems
via "fixes", sometimes applying fixes might lead to producing solutions
which are completely ambiguous when compared to each other, and/or are
incomparable, which leads to `findBestSolutions` erasing all of them
while trying to compute best "partial" solution, which is incorrect.

Resolves: rdar://problem/42678836
2018-08-06 17:25:58 -07:00
Doug Gregor
199bf6eabf Merge pull request #18425 from DougGregor/extended-nominal
[Name lookup] Introduce a request for "extended nominal type decl"
2018-08-06 08:23:36 -07:00
Pavel Yaskevich
913f3710c6 Merge pull request #18484 from xedin/diag-req-failures-via-fixes
[ConstraintSystem] Diagnose missing conformance requirements via "fixes"
2018-08-03 19:23:06 -07:00
Pavel Yaskevich
f15e17a629 [Sema] NFC: reword "only concrete types can conform to protocols" diagnostic 2018-08-03 14:27:00 -07:00
Doug Gregor
3018becde7 [Type checker] Eliminate type checking from early extension binding.
Use ExtensionDecl::getExtendedNominal() to wire up extensions to their
nominal types early in type checking (the bindExtensions()) operation,
rather than going through type validation to do so.
2018-08-03 11:26:49 -07:00
Doug Gregor
bd5f5d80e4 [AST] Add ExtensionDecl::getExtendedNominal().
Introduce ExtensionDecl::getExtendedNominal() to provide the nominal
type declaration that the extension declaration extends. Move most
of the existing callers of the callers to getExtendedType() over to
getExtendedNominal(), because they don’t need the full type information.

ExtensionDecl::getExtendedNominal() is itself not very interesting yet,
because it depends on getExtendedType().
2018-08-03 11:26:48 -07:00
Pavel Yaskevich
c2bf3d5ba9 [TypeChecker] NFC: Fix all of the diagnostics improved by conformance tracking 2018-08-02 21:55:16 -07:00
Michael Ilseman
8294c0003a [string] Drop _StringGuts subscript; NFC
_StringGuts shouldn't expose a subscript, implying efficient
access. Switch to the explicit code unit fetch method. Update tests
accordingly, and switch off of deprecated typealiases.
2018-08-02 16:34:22 -07:00
Michael Ilseman
ced2e63d95 [test] Make string internal testing a little more robust; NFC
Add an isSmall query to Character so testing doesn't have to bake in
internal format. Clarify the purpose of the invalid UTF-16 backdoor
creation method.
2018-08-02 16:34:19 -07:00
Michael Ilseman
ba6158d74e [test] Internalize _StringGuts; Add shared testing struct; NFC
Create a _StringRepresentation struct to standardize internal testing
on. Internalize much of _StringGuts, except for some SPI hacks, and
update tests to use _StringRepresentation.
2018-08-01 14:23:56 -07:00
Ben Rimmington
2f326bcc88 [stdlib] Remove theGlobalMT19937
SwiftPrivate/PRNG.swift:

- currently uses `theGlobalMT19937`;
- previously used `arc4random` (see #1939);
- is obsoleted by SE-0202: Random Unification.
2018-08-01 13:00:16 +01:00
Mishal Shah
0ef312ff78 Merge pull request #18409 from apple/swift-master-xcode-10-beta-5
Update master to build with Xcode 10 beta 5, macOS 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs
2018-07-31 15:04:02 -07:00
swift-ci
f744bc536b Merge pull request #18379 from milseman/three_free 2018-07-31 13:43:05 -07:00
Mishal Shah
13f5118a92 Update master to build with Xcode 10 beta 5, macOS 10.14, iOS 12, tvOS 12, and watchOS 5 SDKs 2018-07-31 13:05:42 -07:00
Michael Ilseman
a7d3c7079b [test] Adjust String.swift tests for non-small strings on 32b; NFC 2018-07-31 11:23:51 -07:00
Graydon Hoare
ff88c7f369 Merge pull request #18362 from graydon/rdar-41271283-batch-mode-limit-memory-pressure-on-large-modules
[BatchMode] <rdar://41271283> Limit memory pressure on large modules.
2018-07-31 08:46:35 -07:00
Karoy Lorentey
517e7806a0 Merge pull request #17907 from lorentey/crashes-scare-counters2
[test] Re-add crash tests for getObjects:andKeys:count:
2018-07-31 14:55:17 +01:00
Michael Ilseman
534a17aebb [test] Migrate String.swift off of Swift 3; NFC 2018-07-30 17:38:25 -07:00
Graydon Hoare
d5a9f44e4a [BatchMode] <rdar://41271283> Limit memory pressure on large modules. 2018-07-30 17:26:31 -07:00
Michael Ilseman
143e8d9caf [test] Migrate StringViews.swift off of Swift 3; NFC 2018-07-30 17:26:30 -07:00
swift-ci
a14889cc3d Merge pull request #18365 from rudkx/disable-typechecker-perf-test 2018-07-30 16:16:31 -07:00
Mark Lacey
9a3e282066 Temporarily disable performance test that is 'failing' by running too fast.
I am reworking these to be based on the scope counter rather than a
timer.

rdar://problem/42744631
2018-07-30 15:44:37 -07:00
Joe Groff
f8e5ebe873 Merge pull request #18299 from jckarter/enable-key-path-resilience
Enable key path resilience.
2018-07-30 13:00:43 -07:00
Joe Groff
38e339db06 Enable key path resilience test suite.
With a few modifications:

- Changing computed get-only properties into 'let's breaks resilience in other ways we need to fix independent of key path resilience
- Fix the tests not to ask for impossible lib-before--client-after compatibility for changes that add API
2018-07-30 10:09:40 -07:00
Rintaro Ishizaki
c5a84565d7 [Parse] Fix end location of dummy top level code for code completion
Fix ASTVerifier error for end location of 'IfConfigDecl'.
Previously, for:
```
  #if
  // something
  <COMPLETE>
```
End location of the dummy body of 'TopLevelCodeDecl' was at the eof, but the
end loc of the 'IfConfigDecl' was at the code-completion token. That
caused the ASTVerifier error "invalid IfConfigStmt end location".

https://bugs.swift.org/browse/SR-2364
rdar://problem/41217187
2018-07-30 20:23:26 +09:00
Pavel Yaskevich
ae4e106491 Merge pull request #18281 from xedin/gather-constraints-improvements
[Perf Experiment][ConstraintGraph] Gather constraints improvements
2018-07-28 00:27:36 -07:00
Doug Gregor
d9c6fcfefa Merge pull request #18305 from DougGregor/constraint-solver-timer-perf
[Constraint solver] Reduce timer overhead associated with "expression too complex"
2018-07-27 17:11:28 -07:00
Doug Gregor
fa9a24538f [Standard library] Ascribe types to some literals to improve typecheck time.
One expression in the new hashing implementation is going exponential,
accounting for a huge amount of type-checking type. Add (admittedly ugly)
“as UInt64” annotations to greatly reduce the time to type-check this
expression.

*Ahem* type-checking time for the standard library goes from 24s->14s with
this change. Added a type-checker “slow” performance test and captured
the problem in rdar://problem/42672946.
2018-07-27 14:10:49 -07:00
Michael Gottesman
6be8a68c41 [update-checkout] Do not run tests when testing simulators.
Feedback from Mishal on 0b8381ae78.
2018-07-27 12:39:34 -07:00
Mark Lacey
78d83e5703 Use %target-typecheck-verify-swift where possible. 2018-07-26 23:13:43 -07:00
Pavel Yaskevich
dd798accd8 [ConstraintGraph] Use set to gather constraints for type variables
Since it's possible to find the same constraint through two different
but equivalent type variables, let's use a set to store constraints
instead of a vector to avoid processing the same constraint multiple
times.
2018-07-26 22:41:07 -07:00
Jordan Rose
ae6645d808 [test] Move a slow Driver test to the validation suite (#18261) 2018-07-26 17:53:43 -07:00
Doug Gregor
059163360a Re-enable Lazy test on Linux.
Arnold fixed this by re-computing the insert position in
getSpecializedConformance(), with
https://github.com/apple/swift/pull/17904.

Fixes rdar://problem/35797159.
2018-07-26 16:07:37 -07:00
Doug Gregor
b421d08955 [GSB] Use resolved type when looking for a representative constraint.
When looking for a representative superclass constraint, take into
account other same-type constraints by comparing against the resolved
superclass constraint type rather than the type as spelled.

Fixes SR-8179 / rdar://problem/41851224.
2018-07-26 12:42:29 -07:00
Pavel Yaskevich
a9ebaef2e5 Merge pull request #18227 from xedin/diagnose-missing-labels-using-fixes
[ConstraintSystem] Use fixes to diagnose missing/extraneous/incorrect argument labels
2018-07-26 12:01:28 -07:00
Michael Gottesman
0b8381ae78 [update-checkout] Move all files except the top level entrypoints into ./utils/update_checkout/*.
This makes update_checkout into a true python module that we can add nosetests
for, readme, and also split up without issue into multiple small files.

I also added a small stub test directory and support for running tests for
update_checkout during validation-testing. So once we add some tests, everything
is setup correctly in terms of the swift build for testing purposes.
2018-07-26 10:07:18 -07:00