Skip to content

Using lower cased enum name is error prone #85

@kevinresol

Description

@kevinresol

Explained with the following example

@:enum abstract MyEnum(String)
{
  var test = 'test'; // snow-style
}

switch(myEnum)
{
  // suppose we have a typo:
  case text: 
  // compiles fine because "text" is treated as a capture variable
}
@:enum abstract MyEnum(String)
{
  var MTest = 'test'; // haxe-std-lib-style
}

switch(myEnum)
{
  // suppose we have a similar typo:
  case MText: 
  // failed to compile because MText is not part of MyEnum, 
  // and haxe does not treat it as capture variable because it starts with capitalized letter
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions