Files
swift-mirror/test/ClangImporter/enum-error-case-alias.swift
Slava Pestov b903382866 ClangImporter: Fix importEnumCaseAlias() when the original is itself an alias
This comes up when an imported error enum has duplicate cases.
The FooError.Code enum has an alias for the duplicate case, and
the wrapper type FooError defines aliases for every member of
FooError.Code.

The implementation of importEnumCaseAlias() assumed that 'original'
was an EnumElementDecl, and built AST accordingly; however if it
is a 'VarDecl', we have to build a MemberRefExpr instead.

This regression was introduced in https://github.com/apple/swift/pull/25009.

Fixes <rdar://problem/58552618>.
2020-02-06 19:47:05 -05:00

11 lines
385 B
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-sil %s -enable-objc-interop -I %S/Inputs/custom-modules/AliasCaseErrorEnum
// REQUIRES: objc_interop
import AliasCaseErrorEnum
// Make sure that we can reference aliases defined in the wrapper type
// which themselves point at aliases inside the nested 'Code' type.
_ = AliasError.realName
_ = AliasError.fakeName