djinni icon indicating copy to clipboard operation
djinni copied to clipboard

Having a variable in a record with the same name as an enum produces an error on ObjC

Open ErikGoldman opened this issue 11 years ago • 1 comments

MyEnum = enum {
   blah;
   bloop;
}

MyRecord = record {
  myEnum: MyEnum;
}

Opening this in Objective-C throws the error "must use 'enum' to refer to type MyEnum in this scope" in the MyEnumTranslator.mm file. It also upper-cases the variable name myEnum so it becomes MyEnum, making the variable name and enum name conflict.

ErikGoldman avatar Sep 15 '14 23:09 ErikGoldman

Sort of a tangent: Djinni expects all identifiers in the ".djinni" file to be of the form "foo_bar". Maybe it should warn when they aren't?

cakoose avatar Sep 22 '14 06:09 cakoose