Files
swift-mirror/test/Interop/Cxx/enum/Inputs/CenumsNSOptions.apinotes
Nuri Amari fb14414bc9 Fix assertion failure importing NS_OPTION with differing Swift name across versions
At the call sites of `findAnonymousEnumForTypedef` we often wish to
import the returned enum declaration and return the type the declaration
creates.

Prior to this patch, we assumed that the enum declaration would be
imported as a `NominalTypeDecl`. This is not always the case. For
whatever reason, sometimes in typechecking we import a declaration
for various different naming versions. If the Swift name for an imported
enum differs between the canonical name version, and currently
requested name version, we import the enum as a `TypeAliasDecl` instead.

Prior to this patch, this meant we would hit asserts importing some
components of UIKit.

This patch relaxes the assumption that the import is a `NominalTypeDecl`
to just a `TypeDecl`, which as of yet, seems to be true.
2023-02-16 08:44:44 -08:00

23 lines
566 B
Plaintext

Name: CenumsNSOptions
Enumerators:
- Name: API_NOTES_NAMED_OptionOne
SwiftName: SwiftOptionOneApiNotes
- Name: API_NOTES_NAMED_OptionTwo
SwiftName: SwiftOptionTwoApiNotes
- Name: API_NOTES_NAMED_OptionThree
SwiftName: SwiftOptionThreeApiNotes
- Name: API_NOTES_NAMED_OptionFour
SwiftName: SwiftOptionFourApiNotes
Tags:
- Name: UIPrinterJobTypes
SwiftName: UIPrinter.JobTypes
- Name: Baz
SwiftName: CurrentBazVersion
SwiftVersions:
- Version: 4
Tags:
- Name: UIPrinterJobTypes
SwiftName: UIPrinterJobTypes
- Name: Baz
SwiftName: BazVersion4