================================================================================
api/propertiesRenderer4
================================================================================

import "pkl:test"

class Person {
  name: String
  age: Int
}

typealias Email = String

res1 = new PropertiesRenderer {}.renderValue(123)
res2 = new PropertiesRenderer {}.renderValue(1.23)
res3 = new PropertiesRenderer {}.renderValue(false)
res4 = new PropertiesRenderer {}.renderValue("pigeon")
res5 = new PropertiesRenderer {}.renderValue(null)

res6 = test.catch(() -> new PropertiesRenderer {}.renderValue(1.min))
res7 = test.catch(() -> new PropertiesRenderer {}.renderValue(1.mb))
res8 = test.catch(() -> new PropertiesRenderer {}.renderValue(List("pigeon", "parrot")))
res9 = test.catch(() -> new PropertiesRenderer {}.renderValue(Set("pigeon", "parrot")))
res10 = test.catch(() -> new PropertiesRenderer {}.renderValue(Map("name", "pigeon", "age", 42)))
res11 = test.catch(() -> new PropertiesRenderer {}.renderValue(new Listing { "pigeon"; "parrot" }))
res12 = test.catch(() -> new PropertiesRenderer {}.renderValue(new Mapping { ["name"] = "pigeon"; ["age"] = 42 }))
res13 = test.catch(() -> new PropertiesRenderer {}.renderValue(new Dynamic { name = "pigeon"; age = 42 }))
res14 = test.catch(() -> new PropertiesRenderer {}.renderValue(new Person { name = "pigeon"; age = 42 }))
res15 = test.catch(() -> new PropertiesRenderer {}.renderValue(Pair(1, 2)))
res16 = test.catch(() -> new PropertiesRenderer {}.renderValue(Person))
res17 = test.catch(() -> new PropertiesRenderer {}.renderValue(Email))
res18 = test.catch(() -> new PropertiesRenderer {}.renderValue((x) -> x))
res19 = test.catch(() -> new PropertiesRenderer { converters { [Int] = (_) -> throw("ouch") } }.renderValue(42))
res20 = test.catch(() -> new PropertiesRenderer {}.renderValue(IntSeq(1, 4)))

--------------------------------------------------------------------------------

(module
  (importClause
    (stringConstant))
  (clazz
    (identifier)
    (classBody
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))))
  (typeAlias
    (identifier)
    (type
      (qualifiedIdentifier
        (identifier))))
  (classProperty
    (identifier)
    (methodCallExpr
      (newExpr
        (type
          (qualifiedIdentifier
            (identifier)))
        (objectBody))
      (identifier)
      (argumentList
        (intLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (newExpr
        (type
          (qualifiedIdentifier
            (identifier)))
        (objectBody))
      (identifier)
      (argumentList
        (floatLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (newExpr
        (type
          (qualifiedIdentifier
            (identifier)))
        (objectBody))
      (identifier)
      (argumentList
        (falseLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (newExpr
        (type
          (qualifiedIdentifier
            (identifier)))
        (objectBody))
      (identifier)
      (argumentList
        (slStringLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (newExpr
        (type
          (qualifiedIdentifier
            (identifier)))
        (objectBody))
      (identifier)
      (argumentList
        (nullLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (slStringLiteral)
                  (slStringLiteral)))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (slStringLiteral)
                  (slStringLiteral)))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (slStringLiteral)
                  (slStringLiteral)
                  (slStringLiteral)
                  (intLiteral)))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectElement
                    (slStringLiteral))
                  (objectElement
                    (slStringLiteral))))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectEntry
                    (slStringLiteral)
                    (slStringLiteral))
                  (objectEntry
                    (slStringLiteral)
                    (intLiteral))))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectProperty
                    (identifier)
                    (slStringLiteral))
                  (objectProperty
                    (identifier)
                    (intLiteral))))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectProperty
                    (identifier)
                    (slStringLiteral))
                  (objectProperty
                    (identifier)
                    (intLiteral))))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral)))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (variableExpr
                (identifier))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (variableExpr
                (identifier))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (functionLiteral
                (parameterList
                  (typedIdentifier
                    (identifier)))
                (variableExpr
                  (identifier)))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody
                (objectProperty
                  (identifier)
                  (objectBody
                    (objectEntry
                      (variableExpr
                        (identifier))
                      (functionLiteral
                        (parameterList
                          (typedIdentifier
                            (identifier)))
                        (throwExpr
                          (parenthesizedExpr
                            (slStringLiteral)))))))))
            (identifier)
            (argumentList
              (intLiteral)))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (newExpr
              (type
                (qualifiedIdentifier
                  (identifier)))
              (objectBody))
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral))))))))))
