 checkTypes = (ctx) ->
   # failed = mapToArray filterMap ((name) -> name is 'could not unify'), ctx.substitution
   if isFailed ctx.substitution
+    map labelConflicts, ctx.substitution.fails
     ctx.substitution.fails
+
+labelConflicts = (fail) ->
+  if not fail.conflicts
+    return fail
+  map labelConflict, fail.conflicts
+
+labelConflict = (conflict) ->
+  conflict.error = yes
 
 lookupJs = (moduleName) ->
   js = (lookupCompiledModule moduleName)?.js

    "undefined"
  else
    throw new Error "Unrecognized type in printType"

collectArgs = (type) ->
  if type.TypeVariable and type.ref.val

    [expression] = _terms ast
    compilationFn = (topLevelExpressionInModule importsFor moduleDependencies moduleName)
    {js} = compileCtxAstToJs compilationFn, ctx, expression
    errors = checkTypes ctx
    (finalizeTypes ctx, expression)
    js: library + immutable + (listOfLines map lookupJs, (setToArray runtimeDependencies moduleName)) + '\n;' + js
    ast: ast
    errors: errors
    malformed: ctx.isMalformed

importsFor = (moduleSet) ->
