Closed carl314 closed 2 months ago
@AnthonyLatsis This seems to be related to type resolution changes you have been working on.
It might be because dc
provided by CustomAttrTypeRequest
is a protocol nominal instead of the method it's actually attached to.
It might be because
dc
provided byCustomAttrTypeRequest
is a protocol nominal instead of the method it's actually attached to.
Yeah. But the reason this crashes instead of erroring out is that name lookup still finds the method’s generic parameter when given the wrong, nominal declaration context. I wonder if there is anything relying on this name lookup behavior.
Description
I'm hitting a compiler crash when adding a generic result builder annotation to a protocol function requirement.
Reproduction
Example 1, causes an assertion failure + crash backtrace:
Example 2, results in a linker failure:
Stack dump
Expected behavior
The code examples should compile.
Environment
Compiler crash, 5.10, 5.9.2, ..., 5.7.3, 5.4 -- every swift.org open source release Xcode toolchain:
Also occurs with nightly development snapshots (March 31, 2024):
BUT: Compiles with the 5.10 toolchain shipping with Xcode 15.3 (15E204a) and in the swift:latest (05a85cf71d57) docker container:
Additional information
may be related to #61250 ...
FB13823026