Push correct value to stack and use double underscore for private value
@@ -1613,11 +1613,11 @@ static void method(Compiler *compiler, bool private, Token *identifier, bool *ha
continue;
}
- if (strcmp(AS_STRING(entry->key)->chars, "annotatedMethodName") == 0) {
+ if (strcmp(AS_STRING(entry->key)->chars, "__annotatedMethodName") == 0) {
Value existingDict;
dictGet(compiler->methodAnnotations, entry->key, &existingDict);
- push(vm, OBJ_VAL(existingDict));
ObjString *methodKey = copyString(vm, compiler->parser->previous.start, compiler->parser->previous.length);
+ push(vm, OBJ_VAL(methodKey));
dictSet(vm, compiler->methodAnnotations, OBJ_VAL(methodKey), existingDict);
pop(vm);
dictDelete(vm, compiler->methodAnnotations, entry->key);
@@ -1688,7 +1688,7 @@ static void parseMethodAnnotations(Compiler *compiler) {
ObjDict *annotationDict = newDict(vm);
push(vm, OBJ_VAL(annotationDict));
- ObjString *methodName = copyString(vm, "annotatedMethodName", 19);
+ ObjString *methodName = copyString(vm, "__annotatedMethodName", 21);
push(vm, OBJ_VAL(methodName));
dictSet(vm, compiler->methodAnnotations, OBJ_VAL(methodName), OBJ_VAL(annotationDict));
pop(vm);
