Commit Graph

6 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
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
07662fc894 [Sema] Don't report public imports of submodules as being unused in API
An import of a submodule implies an import of its top module, and
referenced decl will be associated with the top module. Make sure
we don't warn on public imports of a submodule being unused in API and
only report if the top module is unused.
2024-01-03 15:27:09 -08:00
Alexis Laferrière
73904ec12f Sema: report inconsistent access levels on imports of one module from one file
Warn on imports of the same target module from the same source file when
they have different access-levels. This situation can lead to unexpected
behavior as the compiler will only take into account the most permissive
import.

In the following example, the module Foundation in functionally imported
as public. The `internal` modifier will be ignored. The new diagnostic
reports it as such.

```
public import Foundation
internal import Foundation // warning: module 'Foundation' is imported
as 'public' from the same file; this 'internal' access level will be
ignored
```

This could be an easy mistake to do when using scoped imports where this
diagnostic will also help.

rdar://117855481
2024-01-03 09:04:49 -08:00