Fix: add missing "const" and "fixed" modifiers to reflect API (#265)

This fixes an issue where the reflect API does not show fixed or const modifiers on a property.
This commit is contained in:
Daniel Chao authored and GitHub committed 2024-02-29 07:02:09 -08:00
1 parent ddfab2a280
commit 6746040362
5 files changed
+20 -4

No files matched your search

@@ -164,6 +164,10 @@ public final class VmModifier {
return "hidden";
case EXTERNAL:
return "external";
case FIXED:
return "fixed";
case CONST:
return "const";
default:
throw new VmExceptionBuilder()
.bug("Cannot convert internal modifier `%s` to a string.", toString(modifier))
@@ -179,6 +183,8 @@ public final class VmModifier {
if (isHidden(modifiers)) builder.add(toString(HIDDEN));
// `external` modifier is part of class contract but not part of property/method contract
if (isExternal(modifiers) && isClass) builder.add(toString(EXTERNAL));
if (isFixed(modifiers)) builder.add(toString(FIXED));
if (isConst(modifiers)) builder.add(toString(CONST));
return builder.build();
}