================================================================================
mappings2/mapping1
================================================================================

class Person {
  name: String
  age: Int
}

function id(x) = x

res1 = new Mapping {}

res2 = new Mapping {
  when (false) { [0] = 0 }
  [null] = null
  [true] = true
  [42] = 42
  [1.23] = 1.23
  ["foo"] = "foo"
  [Regex("bar")] = Regex("bar")
  [5.gb] = 5.gb
  [3.min] = 3.min
  [Pair(1, 2)] = Pair(1, 2)
  [List(1, 2, 3)] = List(1, 2, 3)
  [Set(1, 2, 3)] = Set(1, 2, 3)
  [Map("one", 1, "two", 2)] = Map("one", 1, "two", 2)
  [new Dynamic { name = "Pigeon"; age = 42 }] = new Dynamic { name = "Pigeon"; age = 42 }
  [new Person { name = "Pigeon"; age = 42 }] = new Person { name = "Pigeon"; age = 42 }
  [new Listing { 1; 2; 3 }] = new Listing { 1; 2; 3 }
  [new Mapping { ["one"] = 1; ["two"] = 2 }] = new Mapping { ["one"] = 1; ["two"] = 2 }
}

res3 = new Mapping {
  when (false) { [0] = 0 }
  [id(null)] = id(null)
  [id(true)] = id(true)
  [id(42)] = id(42)
  [id(1.23)] = id(1.23)
  [id("foo")] = id("foo")
  [id(Regex("bar"))] = id(Regex("bar"))
  [id(5.gb)] = id(5.gb)
  [id(3.min)] = id(3.min)
  [id(Pair(1, 2))] = id(Pair(1, 2))
  [id(List(1, 2, 3))] = id(List(1, 2, 3))
  [id(Set(1, 2, 3))] = id(Set(1, 2, 3))
  [id(Map("one", 1, "two", 2))] = id(Map("one", 1, "two", 2))
  [id(new Dynamic { name = "Pigeon"; age = 42 })] = id(new Dynamic { name = "Pigeon"; age = 42 })
  [id(new Person { name = "Pigeon"; age = 42 })] = id(new Person { name = "Pigeon"; age = 42 })
  [id(new Listing { 1; 2; 3 })] = id(new Listing { 1; 2; 3 })
  [id(new Mapping { ["one"] = 1; ["two"] = 2 })] = id(new Mapping { ["one"] = 1; ["two"] = 2 })
}

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

(module
  (clazz
    (identifier)
    (classBody
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))))
  (classMethod
    (methodHeader
      (identifier)
      (parameterList
        (typedIdentifier
          (identifier))))
    (variableExpr
      (identifier)))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody)))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody
        (whenGenerator
          (falseLiteral)
          (objectBody
            (objectEntry
              (intLiteral)
              (intLiteral))))
        (objectEntry
          (nullLiteral)
          (nullLiteral))
        (objectEntry
          (trueLiteral)
          (trueLiteral))
        (objectEntry
          (intLiteral)
          (intLiteral))
        (objectEntry
          (floatLiteral)
          (floatLiteral))
        (objectEntry
          (slStringLiteral)
          (slStringLiteral))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (slStringLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (slStringLiteral))))
        (objectEntry
          (propertyCallExpr
            (intLiteral)
            (identifier))
          (propertyCallExpr
            (intLiteral)
            (identifier)))
        (objectEntry
          (propertyCallExpr
            (intLiteral)
            (identifier))
          (propertyCallExpr
            (intLiteral)
            (identifier)))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)
              (intLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)
              (intLiteral))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)
              (intLiteral)
              (intLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)
              (intLiteral)
              (intLiteral))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)
              (intLiteral)
              (intLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)
              (intLiteral)
              (intLiteral))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (slStringLiteral)
              (intLiteral)
              (slStringLiteral)
              (intLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (slStringLiteral)
              (intLiteral)
              (slStringLiteral)
              (intLiteral))))
        (objectEntry
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectProperty
                (identifier)
                (slStringLiteral))
              (objectProperty
                (identifier)
                (intLiteral))))
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectProperty
                (identifier)
                (slStringLiteral))
              (objectProperty
                (identifier)
                (intLiteral)))))
        (objectEntry
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectProperty
                (identifier)
                (slStringLiteral))
              (objectProperty
                (identifier)
                (intLiteral))))
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectProperty
                (identifier)
                (slStringLiteral))
              (objectProperty
                (identifier)
                (intLiteral)))))
        (objectEntry
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectElement
                (intLiteral))
              (objectElement
                (intLiteral))
              (objectElement
                (intLiteral))))
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectElement
                (intLiteral))
              (objectElement
                (intLiteral))
              (objectElement
                (intLiteral)))))
        (objectEntry
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectEntry
                (slStringLiteral)
                (intLiteral))
              (objectEntry
                (slStringLiteral)
                (intLiteral))))
          (newExpr
            (type
              (qualifiedIdentifier
                (identifier)))
            (objectBody
              (objectEntry
                (slStringLiteral)
                (intLiteral))
              (objectEntry
                (slStringLiteral)
                (intLiteral))))))))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody
        (whenGenerator
          (falseLiteral)
          (objectBody
            (objectEntry
              (intLiteral)
              (intLiteral))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (nullLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (nullLiteral))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (trueLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (trueLiteral))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (intLiteral))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (floatLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (floatLiteral))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (slStringLiteral)))
          (methodCallExpr
            (identifier)
            (argumentList
              (slStringLiteral))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (slStringLiteral)))))
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (slStringLiteral))))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier))))
          (methodCallExpr
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier)))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier))))
          (methodCallExpr
            (identifier)
            (argumentList
              (propertyCallExpr
                (intLiteral)
                (identifier)))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral)))))
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral))))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral)
                  (intLiteral)))))
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral)
                  (intLiteral))))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral)
                  (intLiteral)))))
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (intLiteral)
                  (intLiteral)
                  (intLiteral))))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (slStringLiteral)
                  (intLiteral)
                  (slStringLiteral)
                  (intLiteral)))))
          (methodCallExpr
            (identifier)
            (argumentList
              (methodCallExpr
                (identifier)
                (argumentList
                  (slStringLiteral)
                  (intLiteral)
                  (slStringLiteral)
                  (intLiteral))))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectProperty
                    (identifier)
                    (slStringLiteral))
                  (objectProperty
                    (identifier)
                    (intLiteral))))))
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectProperty
                    (identifier)
                    (slStringLiteral))
                  (objectProperty
                    (identifier)
                    (intLiteral)))))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectProperty
                    (identifier)
                    (slStringLiteral))
                  (objectProperty
                    (identifier)
                    (intLiteral))))))
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectProperty
                    (identifier)
                    (slStringLiteral))
                  (objectProperty
                    (identifier)
                    (intLiteral)))))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectElement
                    (intLiteral))
                  (objectElement
                    (intLiteral))
                  (objectElement
                    (intLiteral))))))
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectElement
                    (intLiteral))
                  (objectElement
                    (intLiteral))
                  (objectElement
                    (intLiteral)))))))
        (objectEntry
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectEntry
                    (slStringLiteral)
                    (intLiteral))
                  (objectEntry
                    (slStringLiteral)
                    (intLiteral))))))
          (methodCallExpr
            (identifier)
            (argumentList
              (newExpr
                (type
                  (qualifiedIdentifier
                    (identifier)))
                (objectBody
                  (objectEntry
                    (slStringLiteral)
                    (intLiteral))
                  (objectEntry
                    (slStringLiteral)
                    (intLiteral)))))))))))
