[SR-14324] "error: circular reference" when typealias in overlay mentions RawValue in underlying clang module #56683
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
serialization
Area → compiler: Serialization & deserialization
Additional Detail from JIRA
md5: a19ef3eb97607bb1474dce70285ddd01
Issue Description:
When deserializing a typealias, Swift immediately tries to resolve its underlying type. When the typealias is in a Swift extension of a clang type in an overlay, and the typealias's underlying type starts with a reference to a typealias created by the ClangImporter, this can cause a DirectLookupRequest for a particular name within a DirectLookupRequest for the exact same name. The request evaluator diagnoses this as a circular reference and the project fails to build.
Reproducing this is slightly complicated, so rather than try to attach a project, I am committing test cases for it in #36375. test/CircularReference/overlay_extensions.swift is an actual example of it happening during the GenericSpecializer pass. test/CircularReference/pretty_printed_decls.swift also makes it happen by using a debugging feature.
(I'm filing this bug first so the tests can reference the SR number.)
The text was updated successfully, but these errors were encountered: