================================================================================
errors/objectCannotHaveElement2
================================================================================

class Foo {
  normalProperty: Boolean
  nestedStructure: Bar
}

class Bar {
  propertyInNestedStructure: Listing<String>
}

foo = new Foo {
  nestedStructure {
    propertyInNestedStructure {
      "Hello world"
    }
  }
  normalProperty = true
}

foo2 = (foo) {
  (nestedStructure.propertyInNestedStructure) { "Hello world!!!" }
  normalProperty = false
}

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

(module
  (clazz
    (identifier)
    (classBody
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier)))))))
  (clazz
    (identifier)
    (classBody
      (classProperty
        (identifier)
        (typeAnnotation
          (type
            (qualifiedIdentifier
              (identifier))
            (typeArgumentList
              (type
                (qualifiedIdentifier
                  (identifier)))))))))
  (classProperty
    (identifier)
    (newExpr
      (type
        (qualifiedIdentifier
          (identifier)))
      (objectBody
        (objectProperty
          (identifier)
          (objectBody
            (objectProperty
              (identifier)
              (objectBody
                (objectElement
                  (slStringLiteral))))))
        (objectProperty
          (identifier)
          (trueLiteral)))))
  (classProperty
    (identifier)
    (objectLiteral
      (parenthesizedExpr
        (variableExpr
          (identifier)))
      (objectBody
        (objectElement
          (objectLiteral
            (parenthesizedExpr
              (propertyCallExpr
                (variableExpr
                  (identifier))
                (identifier)))
            (objectBody
              (objectElement
                (slStringLiteral)))))
        (objectProperty
          (identifier)
          (falseLiteral))))))
