     (all zipWith typeEq, a.constraints, b.constraints) and
       (typeEq a.type, b.type)
   else if a instanceof ClassConstraint and b instanceof ClassConstraint
-    a.className is b.className and (all zipWith typeEq, a.types, b.types)
+    a.className is b.className and typeEq a.types, b.types
+  else if a instanceof Types and b instanceof Types
+    all zipWith typeEq, a.types, b.types
   else
     no
 

    [o t r] g
  """
  "o", 4
  # The following doesn't work because the Collection type class specifies
  # that the constructor takes only one argument.
  #

    errors: checkTypes ctx

compileExpression = (source, moduleName = '@unnamed') ->
  ast = (astFromSource "(#{source})", -1, -1)
  if _empty _terms ast
    {
      ast: ast
      js: ''
    }
  else
    module = lookupInMap compiledModules, moduleName
    toInject = concatSets (collectRequiresFor moduleName), (newSetWith moduleName)
    ctx = injectedContext toInject
    [expression] = _terms ast
    {js} = compileCtxAstToJs topLevelExpression, ctx, expression
    (attachPrintedTypes ctx, expression)
    js: library + immutable + (listOfLines map lookupJs, setToArray toInject) + js
    ast: ast
    errors: checkTypes ctx

# Primitive type checking for now
checkTypes = (ctx) ->
