Commit Graph

5899 Commits

Author SHA1 Message Date
Doug Gregor
99d9c94ab9 Add now-fixed test case for rdar://problem/45590743 2019-10-11 20:54:52 -07:00
Slava Pestov
eef8c11dd9 This test case only fails with asserts on
Fixes <rdar://problem/56196703>.
2019-10-11 18:44:10 -04:00
Slava Pestov
de8745b733 Sema: Simplify error handling in typeCheckParameterList() 2019-10-10 13:08:08 -04:00
Brent Royal-Gordon
eca51d4d53 Fix keypath-as-function crasher
The autoclosures generated for the keypath-as-function feature were not added to the list of closures that needed captures computed. In top-level code, this caused a crash. Fixes rdar://problem/56055600.
2019-10-08 18:11:41 -07:00
Hamish Knight
e2096ae34d [CSDiagnostics] Tweak candidate note text for arg mismatch
Number the parameters starting at 1 in order to
match other diagnostics such as
diag::missing_argument_positional, and change the
text to make it explicit that we're referring to
the parameter position (rather than argument
position).
2019-10-03 15:26:31 -07:00
Brent Royal-Gordon
14477a7610 Merge pull request #27480 from brentdax/absence-of-results
Fix StringInterpolationProtocol validation crasher
2019-10-01 23:57:11 -07:00
Rintaro Ishizaki
f88fb20a01 [SyntaxParse] Mark a SIL crasher test case "fixed" 2019-10-01 17:55:41 -07:00
Brent Royal-Gordon
6456b39660 Fix StringInterpolationProtocol validation crasher
Some old circularity-breaking code caused an unexpected null type, which led to crashes in the decl checker when trying to check that an `appendInterpolation` method in a different file would satisfy the informal requirement for one in a StringInterpolationProtocol conformer. This code appears to now be unnecessary, so this commit removes it. Fixes rdar://problem/55864759.
2019-10-01 17:43:42 -07:00
Pavel Yaskevich
10b1baebb2 Merge pull request #27362 from xedin/port-missing-args
[Diagnostics] Port missing argument(s) diagnostics
2019-09-25 21:08:54 -07:00
Pavel Yaskevich
ec6a874ac8 [TypeChecker] NFC: Update test-cases improved by new missing arguments diagnostic 2019-09-25 10:47:26 -07:00
Slava Pestov
c6c1573423 Merge pull request #27287 from slavapestov/typealias-sugar
Preserve TypeAliasType sugar when substituting types
2019-09-24 21:25:15 -04:00
Robert Widmann
a331dee8e4 Merge pull request #27340 from CodaFi/party-crashers
Extensions Do Not Have Parent Signatures
2019-09-24 15:24:56 -07:00
Slava Pestov
0ade7b70d9 AST: Type::subst() preserves TypeAliasType sugar
Fixes <rdar://problem/45313760>.
2019-09-24 17:42:15 -04:00
Robert Widmann
574a450537 Extensions Do Not Have Parent Signatures
Remove the parent signature from consideration when computing the
generic signature for an extension.  This cuts off a series of crashers
that involved nested extensions with trailing where clauses a la

extension Foo {
  extension Foo where Self.Undefined == Bar {
  }
}

The inner (invalid) extension technically has a parent signature from
Foo itself.  Adding that signature to the GSB means when we go to
register the inner extension's generic parameters we crash.

Since extensions have to occur at the top level, just remove the parent
signature from consideration.

Fixes rdar://55502661
2019-09-24 13:13:51 -07:00
Suyash Srijan
9c97153b2a [Test] Adds a test case 2019-09-24 00:45:29 +01:00
Slava Pestov
5189daafd3 Add a couple of crashing test cases 2019-09-20 15:08:47 -04:00
Slava Pestov
8fab074bb5 AST: Fix regression from SubstFlags::UseErrorTypes removal
Note that while the original crasher in the radar is gone, my reduced test
case triggers an IRGen crash on both 5.1 and master because of an unrelated
bug that appears to be related to protocol requirement signatures and
declaration ordering.

Fixes <rdar://problem/54952911>.
2019-09-19 15:50:40 -04:00
Holly Borla
29044e5d34 Merge pull request #27176 from hborla/type-cannot-conform-diag
[Diagnostics] Generalize the "protocol type cannot conform" error to work for all types that cannot conform to protocols.
2019-09-18 10:38:00 -07:00
Jordan Rose
1eaa767407 [test] Run scale-tests on Linux too (#27223)
It's likely that these were listed as "REQUIRES: OS=macosx" to not
redundantly run them for iOS et al, but they don't take that long and
so it's more useful for Linux devs to be able to run them locally if
need be. Or to catch something that really is different on non-macOS.
2019-09-18 08:27:37 -07:00
Holly Borla
bf80250c84 Merge remote-tracking branch 'upstream/master' into type-cannot-conform-diag 2019-09-17 11:54:03 -07:00
Holly Borla
7687293b7b [Diagnostics] Adjust the description of existential types for the
type_cannot_conform diagnostic message.
2019-09-17 11:52:43 -07:00
Holly Borla
2a7e0099d2 [Diagnostics] Add notes for the type_cannot_conform error that point
to the declaration that requires protocol conformance.
2019-09-17 09:22:07 -07:00
Holly Borla
173e4526ee [Diagnostics] Adjust wording of type_cannot_conform error message. 2019-09-16 14:55:38 -07:00
Pavel Yaskevich
f302da0f9b Merge pull request #27063 from xedin/diag-arg-conversion-failure
[Diagnostics] Introduce argument-to-parameter mismatch
2019-09-16 01:14:15 -07:00
Doug Gregor
d74a24be37 [AST] Look through ConstructorRefCallExpr to find direct callee.
Fixes SR-11062 / rdar://problem/54141935
2019-09-13 22:37:43 -07:00
Pavel Yaskevich
88c39db0c3 [Diagnostics] NFC: Fix improved test-cases related to argument-to-parameter mismatches 2019-09-13 22:35:53 -07:00
Pavel Yaskevich
001f46231c [Diagnostics] Fix a typo in argument mismatch diagnostic note 2019-09-13 22:35:52 -07:00
Pavel Yaskevich
a1643d94f7 [Diagnostics] NFC: Update all of the improved test-cases 2019-09-13 22:35:52 -07:00
Holly Borla
40985b6eb7 [Diagnostics] Generalize the "protocol type cannot conform" error to
work for all types that cannot conform to protocols.
2019-09-13 14:51:17 -07:00
Jordan Rose
dc59cd2043 [Sema] Stop visiting existential exprs an extra time checking for uses (#27150)
This was causing an exponential amount of time traversing the AST with
deeply chained protocol extension methods, such as in the
TestCodableRouter.swift test in Kitura.

If the OpaqueValueExpr is referenced more than once within the
OpenExistentialExpr it'll still get visited more than once, but that
doesn't seem to happen in practice. If it turns out to be a problem,
we can weaken the assertion I'm adding here.

https://bugs.swift.org/browse/SR-11012
2019-09-12 20:21:22 -07:00
Holly Borla
0434d58ff0 Merge pull request #27123 from hborla/missing-conformance-diag
[ConstraintSystem] Allow fixing missing conformance failures for `Void` and uninhabited types.
2019-09-12 17:41:19 -07:00
Holly Borla
b2ec5b97b9 [Test] Update type_checker_crashers_fixed/rdar50869732.swift with missing
conformance diagnostics.
2019-09-12 15:41:11 -07:00
Holly Borla
911bcee863 [Test] Update compiler_crashers_2_fixed/0196-rdar48937223.swift with new
missing conformance diagnostics.
2019-09-12 14:23:54 -07:00
Doug Gregor
6329fc0a92 Add fixed crasher from rdar://problem/54609704 2019-09-12 08:55:35 -07:00
Rintaro Ishizaki
da95961de2 [SyntaxParse] Fix a crash in TokenReceiver
rdar://problem/55267292
2019-09-11 10:51:07 -07:00
Jorge Revuelta Herrero
cec0821220 Compiler crash for SR11108 2019-09-11 13:47:15 +02:00
Luciano Almeida
28d3c6c668 Addressing CR comments 2019-09-07 15:06:45 -03:00
Luciano Almeida
ef8af2a057 Adding valid conventions on tests 2019-09-07 12:30:19 -03:00
Luciano Almeida
697c6d1b13 Check for @autoclosure and @convention(c/block) 2019-09-07 11:14:16 -03:00
Luciano Almeida
3401d24945 Adding crasher sr11027 2019-09-07 10:14:39 -03:00
Varun Gandhi
81e7fb45d9 Merge pull request #27064 from varungandhi-apple/vg-mem-hungry-exprcheck-test
Add reduced test case for rdar://problem/54926602.
2019-09-06 17:38:30 -07:00
Varun Gandhi
51db51e796 Add reduced test case for rdar://problem/54926602. 2019-09-06 15:32:44 -07:00
Jordan Rose
e42dd5ac08 [ClangImporter] Protect against re-entrant bridging header loading (#27045)
If, while loading a bridging header, we pick up a Clang module that
claims to have an overlay Swift module, and that Swift module turns
out to have a bridging header, we can end up reallocating the array
of modules to process while we're looping over it. Be defensive
against this occurrence.

This just fixes a crash; it does not at all solve the problem of this
being broken in several ways:

- Accidentally naming your module the same as a system module shadows
  the latter (if the system module is a Swift module) or *makes your
  module into an overlay* (if the system module is a Clang module).

- Bridging headers are only officially supported on executable targets
  and unit tests, but this isn't really enforced.

- Implicit inclusion of a bridging header *when you import a Swift
  module* is a hack to begin with, and a hack that worsens when the
  main module also has a bridging header. (All the bridging headers
  get folded together into the "same" module, which leads to more
  visibility than desired as well as cycles in the import graph.)

- Combining all of these can result in some pretty bizarre behavior.

rdar://problem/54581756
2019-09-05 17:00:14 -07:00
Mike Ash
3e7307b5ce [Reflection] Reenable inherits_ObjCClasses and inherits_NSObject tests on watchOS.
These are working again. I suspect that they were caused by a linker bug we've since worked around.

rdar://problem/50898688
2019-09-04 11:33:30 -04:00
Varun Gandhi
f055791b9a Merge pull request #26939 from varungandhi-apple/vg-mem-hungry-solver-test
Add minimal test case for rdar://problem/54580427.
2019-09-03 09:31:27 -07:00
Pavel Yaskevich
5210e9b7c2 Revert "[AST] Paren'd reference to an IUO function crashes the compiler in SILGen" 2019-09-02 11:02:01 -07:00
swift-ci
95132fd6e6 Merge pull request #26979 from theblixguy/chore/add-compiler-crasher-test 2019-08-31 15:09:16 -07:00
Suyash Srijan
8c5730abe6 [Test] Fix incorrect SR number 2019-08-31 20:10:19 +01:00
Suyash Srijan
d576fc1b83 [Test] Add a compiler crasher 2019-08-31 20:03:06 +01:00
Suyash Srijan
bd53fe355d Revert "[CS] Don't crash when default argument is magic literal and types don't match" 2019-08-31 00:54:37 +01:00