Commit Graph

7 Commits

Author SHA1 Message Date
Hamish Knight
0a71a90af1 [test] Switch to %batch-code-completion in a few tests 2024-06-08 11:50:19 +01:00
Saleem Abdulrasool
99453fc2e8 test: introduce a new %swift-plugin-dir macro
Use this to define the macro location rather than the "host" dir (which
is actually for the build and not the host).  Furthermore, on Windows,
the build dir is /usr/lib/swift as the host content is in the SDK.

This prepares the tests for Windows.
2023-09-04 13:04:18 -07:00
Doug Gregor
b7bfaf3522 [Macros] Fix handling of extension macro conformances and witnesses
Fix two inter-related issues with extension macros that provide
conformances to a protocol, the combined effect of which is that one
cannot meaningfully provide extension macros that implement
conformances to a protocol like Equatable or Hashable that also
supports auto-synthesis.

The first issue involves name lookup of operators provided by macro
expansions. The logic for performing qualified lookup in addition to
unqualified lookup (for operators) did not account for extension
macros in the same manner as it did for member macros, so we would not
find a macro-produced operator (such as operator==) in witness
matching.

The second issue is more fundamental, which is that the conformance
lookup table would create `NormalProtocolConformance` instances for
pre-macro-expansion conformance entries, even though these should
always have been superseded by explicit conformances within the macro
expansion buffers. The end result is that we could end up with two
`NormalProtocolConformance` records for the same conformance. Some
code was taught to ignore the pre-expansion placeholder conformances,
other code was not. Instead, we now refuse to create a
`NormalProtocolConformance` for the pre-expansion entries, and remove
all of the special-case checks for this, so we always using the
superseding explicit conformances produced by the macro expansions (or
error if the macros don't produce them).

Fixes rdar://113994346 / https://github.com/apple/swift/issues/66348
2023-08-16 19:18:36 -07:00
Holly Borla
61e5811d73 [NFC] Update IDE, Index, ModuleInterface, and SourceKit tests to remove
conformance macros.
2023-07-19 12:38:52 -07:00
Slava Pestov
89ad597fe3 Sema: Use getAllMembers() from collectVisibleMemberDecls()
I had to disable typo correction in one test case to get it to pass without
diagnosing a cycle as a result of Sendable checking. But that's OK, because:

- Sendable checking is prone to request cycles and needs to be redesigned
- Typo correction is turned off in production
2023-06-30 12:40:34 -04:00
Doug Gregor
feb5c09d93 Remove OptionSet macro from the standard library. 2023-06-06 23:37:38 -07:00
Rintaro Ishizaki
f9feee6b63 [Parse] Enable SwiftParser parisng for code completion
But disable roundtrip/validation testing. So that macro expansions are
correctly performed in code completion, but avoid an assertion failure
caused by existence of null character in the source buffer.

rdar://107900870
2023-04-11 17:35:52 -07:00