Commit Graph

16 Commits

Author SHA1 Message Date
Daniel Rodríguez Troitiño
ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Alexis Laferrière
f9fe643e48 Sema: Don't report ambiguities on an explicit public import
Silence errors on ambiguous implicitly public imports when a different import
is explicitly public. In this case all imports are public so the ambiguity is
not dangerous and this configuration can happen during adoption of
access-levels on imports. Keep the error when an explicit import is package,
internal or below.

rdar://129037503
2024-06-05 10:34:26 -07:00
Alexis Laferrière
e4ac42b458 Merge pull request #73176 from xymus/silence-ambiguity-warning
Sema: Offer solution to silence inconsistent import access-level warnings
2024-04-22 15:28:05 -07:00
Alexis Laferrière
134b34728b Sema: Reference InternalImportsByDefault as being an upcoming feature 2024-04-22 12:14:44 -07:00
Alexis Laferrière
bd9c385ce5 Sema: Offer solution to silence inconsistent import access-level warnings
Adoption InternalImportsByDefault provides a safe access-level by default
to imports, as such ambiguities are not a risk and showing this warning is
superflous. When this warning is shown, make sure we note this alternative.
2024-04-22 10:52:21 -07:00
Alexis Laferrière
a890d8fded Sema: Remove internal imports by default from Swift 6
The language steering group has decided to revert their previous
decision and remove this feature from Swift 6.

rdar://126318567
2024-04-19 12:19:29 -07:00
Holly Borla
bf8f9acfbb Merge pull request #71581 from hborla/swift-6-noasserts 2024-02-13 15:13:26 -08:00
Holly Borla
f1cd9cb422 [Test] Remove REQUIRES: asserts from tests that use -swift-version 6. 2024-02-13 07:13:35 -08:00
Alexis Laferrière
6c55bb6b4b Sema: ignore inconsistent bare imports from a file generated by Xcode
In Swift 5 mode, the compiler reports when two files import the same
module, where one file has a bare import and the other an access-level
import. This avoids unintentionally promoting the import to public when
preexisting code marked it otherwise.

Exempt a file generated by Xcode from this check as it's not user
modifiable.

In the future, we should identify such generated files properly. Either
with a new attribute or in the way they are passed to the compiler.

rdar://122032472
2024-02-12 11:09:38 -08:00
Alexis Laferrière
4237a976f1 Sema: update other tests affected by the new inconsistent imports diagnostics 2024-01-03 09:04:49 -08:00
Alexis Laferrière
8b098ab487 [Tests] Remove the flag AccessLevelOnImport from all tests but one 2023-10-10 09:09:22 -07:00
Alexis Laferrière
322ada60c8 [Sema] Intro flag to default imports to internal, the Swift 6 mode
The feature InternalImportsByDefault makes imports default to internal instead
of public. Applying the Swift 6 behavior of SE-0409 in Swift 5.

Let's use only that flag to track the Swift 6 behavior as well instead
of separately checking for the language version.
2023-10-10 09:09:21 -07:00
Alexis Laferrière
a0b848ea96 [Sema] Report imports marked as public that are not used in API 2023-09-28 13:00:04 -07:00
Alexis Laferrière
ea2465dea6 [Sema] Report uses of package import without a package name 2023-09-05 17:33:49 -07:00
Alexis Laferrière
2ddb859794 [Sema] Restrict tests using Swift 6 mode to asserts compilers 2023-02-28 13:03:54 -08:00
Alexis Laferrière
c6c96c4688 [Sema] Report inconsistent access level on import
When targeting Swift 5 and earlier, the default import is public. To
notify of a possible unintentional public import, raise errors on
default imports when other imports of the same target have an explicit
type.

This check isn't necessary in the tentative Swift 6 mode.
2023-02-27 19:31:52 -08:00