Skip to content

enum expressions that refer to enum members with naming conflicts, are incorrectly resolved #3240

Open
@ThunderFrame

Description

@ThunderFrame

In the code below, Apple and Orange are defined in 2 different enums, and the second enum uses Apple and Orange in expressions. Rubberduck incorrectly resolves Apple and Orange as being members of FoodType, whereas VBA treats them as members of FrutitType...

Public Enum FoodType
  Apple = 4
  Orange = 5
  Plum = 3
End Enum

Public Enum FruitType
  [_First] = 1
  Apple = 1
  Orange = 2
  Applorange = Apple Or Orange 'VBA's resolved value is 3, but in RD, Apple is recognized as FoodType.Apple, and Orange as FoodType.Orange
  [_Last] = 3
End Enum

Metadata

Metadata

Assignees

Labels

bugIdentifies work items for known bugsedge-caseMarks a bug as an edge case that would be nice to fix, but that likely doesn't affect normal use.parse-tree-processingresolverIssue is easier to resolve with knowledge of the internal resolver API and the Antlr4 parse trees.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions