mirror of
https://github.com/apple/pkl.git
synced 2026-04-17 05:59:46 +02:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user