mirror of
https://github.com/apple/pkl.git
synced 2026-05-21 22:36:57 +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:
+4
@@ -49,6 +49,10 @@ stringLiteral: "yes"
|
||||
constrained: String(length.isBetween(3, 10))
|
||||
aliased: MyMap<Person>
|
||||
|
||||
hidden hiddenProp: String
|
||||
const constProp: String = "the const prop"
|
||||
fixed fixedProp: String = "the fixed prop"
|
||||
|
||||
/// class doc comment
|
||||
@MyAnn { text = "class annotation" }
|
||||
open class Person {
|
||||
|
||||
@@ -152,8 +152,11 @@ examples {
|
||||
personClassProperties.keys
|
||||
testHelpers.property(personClassProperties["name"], reflect.stringType)
|
||||
testHelpers.property(personClassProperties["age"], reflect.intType)
|
||||
modClassProps["hiddenProp"].modifiers
|
||||
modClassProps["constProp"].modifiers
|
||||
modClassProps["fixedProp"].modifiers
|
||||
}
|
||||
|
||||
|
||||
["Reflected class methods metadata"] {
|
||||
local personClassMethods = personClass.methods
|
||||
personClassMethods.keys
|
||||
@@ -162,7 +165,7 @@ examples {
|
||||
List(reflect.listType.withTypeArgument(reflect.stringType)),
|
||||
reflect.stringType)
|
||||
}
|
||||
|
||||
|
||||
["Reflected annotation class properties metadata"] {
|
||||
testHelpers.property(myAnnClass.properties["text"], reflect.stringType)
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ facts {
|
||||
}
|
||||
examples {
|
||||
["Reflected module properties of unknown type metadata"] {
|
||||
Set("int", "float", "string", "boolean", "duration", "dataSize", "pair", "list", "set", "map", "listing", "mapping", "dynamic", "typed", "int2", "float2", "string2", "boolean2", "duration2", "dataSize2", "pair2", "list2", "set2", "map2", "listing2", "mapping2", "dynamic2", "typed2", "any", "noth", "unkn", "union", "nullable", "stringLiteral", "constrained", "aliased")
|
||||
Set("int", "float", "string", "boolean", "duration", "dataSize", "pair", "list", "set", "map", "listing", "mapping", "dynamic", "typed", "int2", "float2", "string2", "boolean2", "duration2", "dataSize2", "pair2", "list2", "set2", "map2", "listing2", "mapping2", "dynamic2", "typed2", "any", "noth", "unkn", "union", "nullable", "stringLiteral", "constrained", "aliased", "hiddenProp", "constProp", "fixedProp")
|
||||
new {
|
||||
hasExpectedLocation = true
|
||||
docComment = "module property doc comment"
|
||||
@@ -373,6 +373,9 @@ examples {
|
||||
defaultValue = 42
|
||||
hasExpectedType = true
|
||||
}
|
||||
Set("hidden")
|
||||
Set("const")
|
||||
Set("fixed")
|
||||
}
|
||||
["Reflected class methods metadata"] {
|
||||
Set("sing")
|
||||
|
||||
Reference in New Issue
Block a user