 
 findSuperClassChain = (ctx, className, targetClassName) ->
   for s in (ctx.classNamed className).supers
-    if s.className is targetClassName
-      return [s.className]
-    else if chain = findSuperClassChain ctx, s, targetClassName
-      return join [s], chain
+    name = s.className
+    if name is targetClassName
+      return [name]
+    else if chain = findSuperClassChain ctx, name, targetClassName
+      return join [name], chain
   undefined
 
 typeNamesOfNormalized = (constraint) ->

      declarations: declarations

  classNamed: (name) ->
    for scope in (reverse @scopes)
      if classDeclaration = lookupInMap scope.classes, name
        return classDeclaration

      scope.boundTypeVariables)...

  isClassDefined: (name) ->
    !!@_classNamed name

  addClass: (name, classConstraint, superClasses, declarations) ->
    addToMap @_scope().classes, name,
