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
bf80250c84
Merge remote-tracking branch 'upstream/master' into type-cannot-conform-diag
2019-09-17 11:54:03 -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
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
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
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
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
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
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
Suyash Srijan
9121f45256
Merge pull request #26944 from theblixguy/fix/SR-11394
...
[CSDiagnostics] Fix a crasher in MissingContextualConformanceFailure
2019-08-30 07:53:31 +01:00
Suyash Srijan
016e3dc4a6
[Test] Adds a validation test
2019-08-30 00:07:58 +01:00
Suyash Srijan
f02a5f3c68
[Test] Add a test case
2019-08-25 20:06:16 +01:00
Alexis Laferrière
5092d18511
Merge pull request #26653 from xymus/fix-ta-to-ta
...
Fix compiler crasher on type alias with a cycle in the constraints
2019-08-21 09:48:11 -07:00
Slava Pestov
c3bb0afeac
Sema: Fix null dereference with invalid TypeAliasDecl
...
validateDeclForNameLookup() is going away and this won't happen
at all, but let's make sure we have a regression test.
2019-08-20 14:47:52 -04:00
Nathan Hawes
4641792fe1
[Sema] Fix null derefence when diagnosing in bindFuncDeclToOperator
...
Resolves rdar://problem/54150921
2019-08-15 11:44:14 -07:00
Alexis Laferrière
6166b222e2
Fix compiler crasher on typealias with a cycle in the constraints
...
rdar://problem/52463696
SR-11052
2019-08-13 10:20:40 -07:00
Slava Pestov
2f33356083
AST: Optimize construction of the AnyObject dispatch table
...
Instead of visiting all members of all types and extensions, bail out
early if the type is not a class or protocol, or the extension is not
extending a class. This means we don't visit structs, enums or
protocol extensions at all, which will avoid delayed parsing.
Also, we were evaluating isObjC() on each member, which is an expensive
operation; if the member does not have an explicit @objc we would still
have to check if it overrides an @objc method or witnesses an @objc
protocol requirement.
Since most members are not ever found by dynamic lookup, this is wasted
work. Instead, let's rely on AnyObject lookup filtering non-@objc
members at the call site, which it was already doing anyway.
2019-08-12 17:55:44 -04:00
Pavel Yaskevich
9b635833cc
Merge pull request #26424 from LucianoPAlmeida/sr-8467-invalid-read-get-extra-info
...
SR-8467: Fixing crash on AnyFunctionType::getExtInfo
2019-07-30 19:56:46 -07:00
Luciano Almeida
1a21811797
SR-8467: Fixing crash on AnyFunctionType::getExtInfo
2019-07-30 22:08:47 -03:00
Suyash Srijan
2339b5f9bd
[CSDiagnostics] Move check inside getDeclContext()
2019-07-30 20:27:25 +01:00
Suyash Srijan
e50050b0fb
[CSDiagnostics] Don't crash if we don't have access to the generic param's decl
2019-07-30 19:47:27 +01:00
Doug Gregor
e1b359b8a4
[Type checker] Substitute into alternate properties when trying to fix wrapped property refereces
...
Fixes SR-11149 / rdar://problem/53204113
2019-07-19 15:40:20 -07:00
Doug Gregor
ac5e2f9dce
Add now-fixed test case from rdar://problem/53183030
2019-07-19 10:30:36 -07:00
Doug Gregor
118a557304
[SE-0258] Check for a NULL type.
...
Within invalid code, we might encounter expressions without type
information yet. Check for NULL here.
Fixes crash from rdar://problem/53120878.
2019-07-19 10:26:26 -07:00
Doug Gregor
9f0bc69edc
[Type checker] Classes don't need backing properties to create their implicit constructors
...
Fixes a crash caused by an undiagnosed cycle, rdar://problem/52679284.
2019-07-19 06:53:53 -07:00
Slava Pestov
84b026753e
Add test case for SR-9583
...
https://bugs.swift.org/browse/SR-9583 / rdar://problem/47097468
2019-07-17 18:07:03 -04:00
Slava Pestov
ed3e4dc931
Sema: Add implicit constructors before checking members
2019-07-17 18:07:03 -04:00
Pavel Yaskevich
7add7446d7
Merge pull request #26074 from theblixguy/fix/SR-11074
...
[CS] Don't crash when default argument is magic literal and types don't match
2019-07-17 10:20:49 -07:00
Slava Pestov
48bee3825c
Add regression test for rdar://48994748
2019-07-17 01:18:01 -04:00
Suyash Srijan
1a1bff46d8
[CS] Don't crash when using magic literals as default arg
...
Squash all commits into one
2019-07-17 01:20:25 +01:00
Doug Gregor
bee789e277
[SE-0258] Check for an invalid property wrapper type definition.
...
Fixes the crash-on-invalid in rdar://problem/52081852.
2019-07-08 16:07:51 -07:00
Slava Pestov
7434e37605
Sema: Fix crash with circular property initial values
...
Fixes <rdar://45313700>, <https://bugs.swift.org/browse/SR-9015 >.
2019-06-27 23:13:46 -04:00
Slava Pestov
0a9e1c2176
Sema: Merge two places where we resolve 'Self'
2019-06-26 01:12:27 -04:00
Suyash Srijan
1ce8cdead2
[Test] Adds a test case
2019-06-24 21:58:33 +01:00
Pavel Yaskevich
6605d56781
Merge pull request #25431 from xedin/rdar-48937223
...
[CSApply] Don't try to transform editor placeholder if it's type is invalid
2019-06-13 16:48:50 -07:00
Pavel Yaskevich
26d0324318
[CSApply] Don't try to transform editor placeholder if it's type is invalid
...
CSDiag could re-typecheck closure or other expression which has editor
placeholder inside allowing type variables be bound to unresolved
type, which doesn't really form a valid solution to be applied to AST.
So we need to guard against trying to transform placeholder into a call
to `_undefined` in such case, otherwise in asserts build it's going to
crash with an assert but in release build it would crash in some other
place e.g. xSILGen or trying to type-check captures.
Resolves: rdar://problem/48937223
Resolves: rdar://problem/51599529
2019-06-13 10:55:43 -07:00
Doug Gregor
0216e3b9d3
[Type checker] Compute correct contextual substitutions for local generics.
...
When applying generic arguments to a local generic type within a generic
function, ensure that we correctly produce the contextual substitutions from
the generic function. Fixed with Pavel, who painstakingly tracked down
the bogus substitution.
Fixes SR-9954 / rdar://problem/48223824.
2019-06-12 16:31:32 -07:00
Ben Cohen
e9d4687e31
De-underscore @frozen, apply it to structs ( #24185 )
...
* De-underscore @frozen for enums
* Add @frozen for structs, deprecate @_fixed_layout for them
* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00
Slava Pestov
865b79c516
Add regression test for fixed crasher
2019-05-17 23:08:31 -04:00
Joe Groff
cec9e9e33a
Opaque types require a newer Swift runtime.
...
Check the availability of decls that declare an opaque return type to ensure they deploy to a
runtime that supports opaque types.
rdar://problem/50731151
2019-05-15 11:39:53 -07:00
swift-ci
ed90f333de
Merge pull request #24588 from DougGregor/pattern-type-check-crash
2019-05-07 15:01:31 -07:00