================================================================================
api/pListRenderer4
================================================================================

import "pkl:test"

class Person {
  name: String
  age: Int
}

typealias Email = String

local renderer = new PListRenderer {}

res1 = renderer.renderValue(123)
res2 = renderer.renderValue(1.23)
res3 = renderer.renderValue(false)
res4 = renderer.renderValue("pigeon")
res6 = renderer.renderValue(List("pigeon", "parrot"))
res7 = renderer.renderValue(Set("pigeon", "parrot"))
res8 = renderer.renderValue(Map("name", "pigeon", "age", 42))
res9 = renderer.renderValue(new Listing { "pigeon"; "parrot" })
res10 = renderer.renderValue(new Mapping { ["name"] = "pigeon"; ["age"] = 42 })
res11 = renderer.renderValue(new Dynamic { name = "pigeon"; age = 42 })
res12 = renderer.renderValue(new Person { name = "pigeon"; age = 42 })

res13 = test.catch(() -> renderer.renderValue(null))
res14 = test.catch(() -> renderer.renderValue(1.min))
res15 = test.catch(() -> renderer.renderValue(1.mb))
res16 = test.catch(() -> renderer.renderValue(Person))
res17 = test.catch(() -> renderer.renderValue(Email))
res18 = test.catch(() -> renderer.renderValue((x) -> x))
res19 = test.catch(() -> new PListRenderer { converters { [Int] = (_) -> throw("ouch") } }.renderValue(42))
res20 = test.catch(() -> renderer.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
    (modifier)
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody)))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (intLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (floatLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (falseLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (slStringLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (methodCallExpr
          (identifier)
          (argumentList
            (slStringLiteral)
            (slStringLiteral))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (methodCallExpr
          (identifier)
          (argumentList
            (slStringLiteral)
            (slStringLiteral))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (methodCallExpr
          (identifier)
          (argumentList
            (slStringLiteral)
            (slStringLiteral)
            (slStringLiteral)
            (intLiteral))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (newExpr
          (type
            (qualifiedIdentifier
              (identifier)))
          (objectBody
            (objectElement
              (slStringLiteral))
            (objectElement
              (slStringLiteral)))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (newExpr
          (type
            (qualifiedIdentifier
              (identifier)))
          (objectBody
            (objectEntry
              (slStringLiteral)
              (slStringLiteral))
            (objectEntry
              (slStringLiteral)
              (intLiteral)))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (newExpr
          (type
            (qualifiedIdentifier
              (identifier)))
          (objectBody
            (objectProperty
              (identifier)
              (slStringLiteral))
            (objectProperty
              (identifier)
              (intLiteral)))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (newExpr
          (type
            (qualifiedIdentifier
              (identifier)))
          (objectBody
            (objectProperty
              (identifier)
              (slStringLiteral))
            (objectProperty
              (identifier)
              (intLiteral)))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (variableExpr
              (identifier))
            (identifier)
            (argumentList
              (nullLiteral)))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (variableExpr
              (identifier))
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (variableExpr
              (identifier))
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (variableExpr
              (identifier))
            (identifier)
            (argumentList
              (variableExpr
                (identifier))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (variableExpr
              (identifier))
            (identifier)
            (argumentList
              (variableExpr
                (identifier))))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (variableExpr
        (identifier))
      (identifier)
      (argumentList
        (functionLiteral
          (parameterList)
          (methodCallExpr
            (variableExpr
              (identifier))
            (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
            (variableExpr
              (identifier))
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral))))))))))
