================================================================================
classes/functions4
================================================================================

function a(x) = 2 * x

open class X {
  function a(x) = 3 * x
  function compute() = a(c)
  c = 3
}

class Y extends X {
  function a(x) = 4 * x
  c = 5
}

res1 = new X {}.compute()
res2 = new X { c = 4 }.compute()
res3 = new Y {}.compute()
res4 = new Y { c = 6 }.compute()

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

(module
  (classMethod
    (methodHeader
      (identifier)
      (parameterList
        (typedIdentifier
          (identifier))))
    (binaryExpr
      (intLiteral)
      (variableExpr
        (identifier))))
  (clazz
    (modifier)
    (identifier)
    (classBody
      (classMethod
        (methodHeader
          (identifier)
          (parameterList
            (typedIdentifier
              (identifier))))
        (binaryExpr
          (intLiteral)
          (variableExpr
            (identifier))))
      (classMethod
        (methodHeader
          (identifier)
          (parameterList))
        (methodCallExpr
          (identifier)
          (argumentList
            (variableExpr
              (identifier)))))
      (classProperty
        (identifier)
        (intLiteral))))
  (clazz
    (identifier)
    (classExtendsClause
      (qualifiedIdentifier
        (identifier)))
    (classBody
      (classMethod
        (methodHeader
          (identifier)
          (parameterList
            (typedIdentifier
              (identifier))))
        (binaryExpr
          (intLiteral)
          (variableExpr
            (identifier))))
      (classProperty
        (identifier)
        (intLiteral))))
  (classProperty
    (identifier)
    (methodCallExpr
      (newExpr
        (type
          (qualifiedIdentifier
            (identifier)))
        (objectBody))
      (identifier)
      (argumentList)))
  (classProperty
    (identifier)
    (methodCallExpr
      (newExpr
        (type
          (qualifiedIdentifier
            (identifier)))
        (objectBody
          (objectProperty
            (identifier)
            (intLiteral))))
      (identifier)
      (argumentList)))
  (classProperty
    (identifier)
    (methodCallExpr
      (newExpr
        (type
          (qualifiedIdentifier
            (identifier)))
        (objectBody))
      (identifier)
      (argumentList)))
  (classProperty
    (identifier)
    (methodCallExpr
      (newExpr
        (type
          (qualifiedIdentifier
            (identifier)))
        (objectBody
          (objectProperty
            (identifier)
            (intLiteral))))
      (identifier)
      (argumentList))))
