================================================================================
basic/newInAmendingModuleMethod
================================================================================

amends "baseModule.pkl"

local class Person {
  name: String
  type: String
}

local function pigeon(): Person = new { name = "Pigeon"; type = getClass().simpleName }

local function barnOwl() = new { name = "Barn Owl"; type = getClass().simpleName }

local function parrot(): unknown = new { name = "Parrot"; type = getClass().simpleName }

foo = List(pigeon(), barnOwl(), parrot())

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

(module
  (moduleHeader
    (extendsOrAmendsClause
      (stringConstant)))
  (clazz
    (modifier)
    (identifier)
    (classBody
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))))
  (classMethod
    (methodHeader
      (modifier)
      (identifier)
      (parameterList)
      (typeAnnotation
        (type
          (qualifiedIdentifier
            (identifier)))))
    (newExpr
      (objectBody
        (objectProperty
          (identifier)
          (slStringLiteral))
        (objectProperty
          (identifier)
          (propertyCallExpr
            (methodCallExpr
              (identifier)
              (argumentList))
            (identifier))))))
  (classMethod
    (methodHeader
      (modifier)
      (identifier)
      (parameterList))
    (newExpr
      (objectBody
        (objectProperty
          (identifier)
          (slStringLiteral))
        (objectProperty
          (identifier)
          (propertyCallExpr
            (methodCallExpr
              (identifier)
              (argumentList))
            (identifier))))))
  (classMethod
    (methodHeader
      (modifier)
      (identifier)
      (parameterList)
      (typeAnnotation
        (type)))
    (newExpr
      (objectBody
        (objectProperty
          (identifier)
          (slStringLiteral))
        (objectProperty
          (identifier)
          (propertyCallExpr
            (methodCallExpr
              (identifier)
              (argumentList))
            (identifier))))))
  (classProperty
    (identifier)
    (methodCallExpr
      (identifier)
      (argumentList
        (methodCallExpr
          (identifier)
          (argumentList))
        (methodCallExpr
          (identifier)
          (argumentList))
        (methodCallExpr
          (identifier)
          (argumentList))))))
