 
       methods = map (({rhs}) -> rhs), methodsDeclarations
       # log "methods", methods
-      methodTypes = (rhs.tea for [lhs, rhs] in definitions)
+      methodTypes = (rhs?.tea for [lhs, rhs] in definitions)
       if not all methodTypes
         malformed ctx, call, "missing type of a method"
         return jsNoop()


isValidTypeConstraint = (ctx, expression) ->
  if isCall expression
    if not isAtom _operator expression
      malformed ctx, expression, 'Class name required in a constraint'
      return no
  else

  [t1, t2] = sortBasedOnOriginPosition fromInferred, fromDeclared
  # Dont report for fake types
  declaringType = originOf fromDeclared
  if declaringType and isFake declaringType
    declaringType.inferredType = replaceQuantifiedByOrigin fromInferred
  else
    inferred = "inferred #{printType fromInferred}"
