Commit Graph

269 Commits

Author SHA1 Message Date
Pavel Yaskevich
16dfa6be72 [Diagnostics] Add superclass requirement fix/diagnostic
Extend new requirement failure diagnostics by adding "superclass"
generic requirement failures.
2018-08-21 00:39:21 -07:00
Greg Titus
e0a24ce93f Merge pull request #18827 from gregomni/rvalue-as-lvalue
[ConstraintSystem] Move more lvalue diagnostics over to being handled via ConstraintFix
2018-08-20 20:25:51 -07:00
gregomni
834b550c7c Instead of exposing getSolution, provide a restrictionForType API and use that. 2018-08-20 18:08:40 -07:00
gregomni
19fce5d36f Move another chunk of lvalue diagnostics over to being handled via ConstraintFix. 2018-08-19 13:14:55 -07:00
Pavel Yaskevich
3cc613497c [ConstraintSystem] Add same-type requirement fix/diagnostic
Extend new requirement failure diagnostics by adding "same-type"
generic requirement failures.
2018-08-18 13:05:32 -07:00
Greg Titus
32eacc5e80 Merge pull request #18608 from gregomni/rvalue-as-lvalue
[ConstraintSystem] New FailureDiagnostic for rvalues that should be lvalues
2018-08-18 11:43:23 -07:00
Pavel Yaskevich
6756c57f91 [Diagnostics] NFC: Move logic common to all requirement failures into RequirementFailure
This is going to make adding same-type and superclass requirement
failures might easier, because they only have to supply custom
diagnostic messages and substituted types.
2018-08-16 18:35:24 -07:00
gregomni
9e0dae513c Start changing over rvalue-vs-lvalue errors to be done via constraint system fixes. For this first commit, just handling inout parameter problems. 2018-08-16 17:34:17 -07:00
Pavel Yaskevich
0f411b1102 [Diagnostics] Extract requirement declaration context retrieval into its own method
Change logic to traverse the chain of declaration contexts
starting for "affected" declaration's parent and check if the
requirement is satisfied by one of them, if so return it as
requirement's declaration context.

Extract this logic into a method on `RequirementFailure` to make
it accessible for other types of requirement failure diagnostics.
2018-08-16 01:25:51 -07:00
Pavel Yaskevich
e631a37ef6 [ConstraintSystem] Replace Fix with ConstraintFix throughout solver 2018-08-13 18:10:27 -07:00
Pavel Yaskevich
6d64b1c8a5 [Diagnostics] Some diagnostics possible only when locator is resolved down to expression 2018-08-09 22:23:31 -07:00
Pavel Yaskevich
e2cde5acc2 [Diagnostics] Port 'missing optional unwrap' diagnostic to new abstraction 2018-08-09 17:47:06 -07:00
Pavel Yaskevich
d72c204bad [Diagnostics] Port member access on optional base diagnostic to new abstraction 2018-08-09 17:03:20 -07:00
Pavel Yaskevich
a564042fdc [Diagnostics] Port missing explicit conversion to new abstraction 2018-08-09 17:01:54 -07:00
Pavel Yaskevich
9f9904b65d [Diagnostics] Port missing & diagnostic to new abstraction 2018-08-09 13:57:57 -07:00
Pavel Yaskevich
284e109f1e [Diagnostics] Try to compute precise diagnostic anchor 2018-08-09 13:53:33 -07:00
Pavel Yaskevich
f5aa0d9c75 [Diagnostics] Port missing force downcast diagnostic to new abstraction 2018-08-09 11:56:19 -07:00
Pavel Yaskevich
157dc719e0 [Diagnostics] Port implicitly escaping to type conversion diagnostics to new abstraction 2018-08-09 11:05:33 -07:00
Pavel Yaskevich
776485878f [ConstraintSystem] NFC: Move new diagnostics into separate files - Diagnostics.(h|cpp) 2018-08-06 13:08:47 -07:00