Commit Graph

1 Commits

Author SHA1 Message Date
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