     # TODO: defer if super class instances don't exist yet
     superClassInstances = findSuperClassInstances ctx, instanceType.types, classDefinition
 
-    if hasName
-      instanceName = ctx.definitionName()
-
-      ctx.newScope()
-      freshInstanceType = assignMethodTypes ctx, instanceName,
-        classDefinition, instanceType, constraints
-      freshConstraints = freshInstanceType.constraints
-      definitions = pairs wheres
-      methodsDeclarations = definitionList ctx,
-        (prefixWithInstanceName definitions, instanceName)
-      ctx.closeScope()
-
-      methods = map (({rhs}) -> rhs), methodsDeclarations
-      # log "methods", methods
-      methodTypes = (rhs.tea for [lhs, rhs] in definitions)
-
-      # TODO: defer for class declaration if not defined
-      ## if not ctx.isClassDefined className    ...
-
-      instance = (new Constrained freshConstraints,
-        (new ClassConstraint instanceType.className, freshInstanceType.type))
-      ## if overlaps ctx, instance
-      ##   malformed 'instance overlaps with another', instance
-      ## else
-      ctx.addInstance instanceName, instance
-
-      # """var #{instanceName} = new #{className}(#{listOf methods});"""
-      (jsVarDeclaration (validIdentifier instanceName),
-        (irDefinition (new Constrained freshConstraints, (tupleOfTypes methodTypes).type),
-          (jsNew className, (join superClassInstances, methods))))
-    else
-      'malformed'
+    if not hasName
+      return malformed call, "An instance requires a name"
+    instanceName = ctx.definitionName()
+
+    ctx.newScope()
+    freshInstanceType = assignMethodTypes ctx, instanceName,
+      classDefinition, instanceType, constraints
+    freshConstraints = freshInstanceType.constraints
+    definitions = pairs wheres
+    methodsDeclarations = definitionList ctx,
+      (prefixWithInstanceName definitions, instanceName)
+    ctx.closeScope()
+
+    methods = map (({rhs}) -> rhs), methodsDeclarations
+    # log "methods", methods
+    methodTypes = (rhs.tea for [lhs, rhs] in definitions)
+    if not all methodTypes
+      return (jsMalformed "missing type of a method")
+
+    # TODO: defer for class declaration if not defined
+    ## if not ctx.isClassDefined className    ...
+
+    instance = (new Constrained freshConstraints,
+      (new ClassConstraint instanceType.className, freshInstanceType.type))
+    ## if overlaps ctx, instance
+    ##   malformed 'instance overlaps with another', instance
+    ## else
+    ctx.addInstance instanceName, instance
+
+    # """var #{instanceName} = new #{className}(#{listOf methods});"""
+    (jsVarDeclaration (validIdentifier instanceName),
+      (irDefinition (new Constrained freshConstraints, (tupleOfTypes methodTypes).type),
+        (jsNew className, (join superClassInstances, methods))))
 
 # Makes sure methods are typed explicitly and returns the instance constraint
 # with renamed type variables to avoid clashes

  (irDefinition expression.tea, compiled)

topLevel = (ctx, form) ->
  definitionList ctx, pairs _terms form

definitionList = (ctx, pairs) ->
  compiledPairs = (for [lhs, rhs] in pairs

    s: stringType
    c: charType
  [formatStringToken, args...] = _arguments call
  compiledArgs = termsCompile ctx, args
  call.tea = toConstrained stringType
  if not all map _tea, args
    return malformed call, "Argument not typed"
  types = []
  formatString = _stringValue formatStringToken
  while formatString.length > 0
