Commit Graph

15 Commits

Author SHA1 Message Date
Alex Hoppen
66104395d7 [Sema/SourceKit] Emit same diagnostics for missing protocol requirements on the command line and in SourceKit
Some editors use diagnostics from SourceKit to replace build issues. This causes issues if the diagnostics from SourceKit are formatted differently than the build issues. Make sure they are rendered the same way, removing most uses of `DiagnosticsEditorMode`.

To do so, always emit the `add stubs for conformance` note (which previously was only emitted in editor mode) and remove all `; add <something>` suffixes from notes that state which requirements are missing.

rdar://129283608
2024-08-07 14:01:30 -07:00
Anthony Latsis
c2e5d04669 Test: Find better locations for some updated tests 2021-08-31 19:21:26 +03:00
Suyash Srijan
396087d0d4 [Test] Update existing tests 2021-08-31 19:21:26 +03:00
Kavon Farvardin
c0607b345f Revert "Merge pull request #33767 from theblixguy/chore/remove-self-or-associated-type-diagnostic"
The following regression test added for this feature is not passing:

Swift(linux-x86_64) :: decl/protocol/protocols_with_self_or_assoc_reqs_executable.swift

with a compiler crash happening during SILFunctionTransform "Devirtualizer".

Reverting to unblock CI.

This reverts commit f96057e260, reversing
changes made to 3fc18f3603.
2021-08-26 16:46:42 -07:00
Anthony Latsis
749a0ae853 Test: Find better locations for some updated tests 2021-08-16 18:30:26 +03:00
Suyash Srijan
7834120a87 [Test] Update existing tests 2021-08-16 18:30:26 +03:00
Anthony Latsis
8f43d888b8 Sema: Disallow usage of settable Self-returning storage requirements on existential base 2020-10-07 20:48:16 +03:00
Anthony Latsis
103a821838 Sema: Allow non-final classes to satisfy properties and subscripts with covariant Self 2020-09-20 22:33:44 +03:00
Jordan Rose
545b12fa9f Convert backticks to single-quotes in Sema diagnostics
Let's be consistent!
2018-05-09 21:59:39 -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
Slava Pestov
1df6e51c14 AST: Only print DynamicSelfType as 'Self' for class types
This fixes a regression from the previous patch which got
rid of PrintOptions::StripDynamicSelf.

When printing protocol declarations with a BaseType set in
PrintOptions, we can end up with a DynamicSelfType wrapping
a non-class type, if the protocol requirement returned
Self.

Note that this changes the diagnostic for missing protocol
requirements slightly; we used to sometimes refer to 'Self'
even if the conforming type is not a class, which is not
accepted by the type checker anyway. I believe the new
diagnostics are more correct.
2016-11-19 22:53:54 -08: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
3cb58e833a Restrict non-final class protocol conformance when Self is part of the requirement signature.
When a non-final class satisfies a method requirement that returns
Self, it must do so with a method that also returns (dynamic)
Self. This ensures conformance will be inheritable, closing off an
awful type-safety hole <rdar://problem/16880016>. Other
non-contravariant uses of Self in the signatures of requirements cause
the protocol to be unusable by non-final classes.

I had to leave a tiny little gaping hole for the ~> operator, whose
removal is covered by <rdar://problem/17828741>. We can possibly put
this on firm footing with clever handling of generic witnesses, but
it's not important right now.



Swift SVN r20626
2014-07-28 16:15:16 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Doug Gregor
692d024c4a Protocol conformance checking for DynamicSelf protocols.
Swift SVN r13293
2014-02-01 05:57:53 +00:00